UNPKG

n8n-nodes-base

Version:

Base nodes of n8n

31 lines (28 loc) 1.92 kB
/** * Execute Sub-workflow Node - Version 1.1 - Zod Validation Schemas * * These schemas validate node configuration at runtime. * Use .parse() for strict validation or .safeParse() for error handling. * * Schema helpers (z, expressionSchema, etc.) are passed as parameters * by the schema-validator, not imported from external files. * * @generated - CommonJS JavaScript for runtime loading */ module.exports = function getSchema({ parameters, z, expressionSchema, stringOrExpression, numberOrExpression, booleanOrExpression, resourceLocatorValueSchema, resourceMapperValueSchema, filterValueSchema, assignmentCollectionValueSchema, iDataObjectSchema, resolveSchema }) { // Parameters schema const parametersSchema = z.object({ operation: z.unknown().optional(), source: z.union([z.literal('database'), z.literal('localFile'), z.literal('parameter'), z.literal('url'), expressionSchema]).optional(), workflowId: resolveSchema({ parameters, schema: z.unknown(), required: false, displayOptions: {"show":{"source":["database"]}}, defaults: {"source":"database"} }), workflowPath: resolveSchema({ parameters, schema: stringOrExpression, required: false, displayOptions: {"show":{"source":["localFile"]}}, defaults: {"source":"database"} }), workflowJson: resolveSchema({ parameters, schema: z.union([iDataObjectSchema, z.string()]), required: false, displayOptions: {"show":{"source":["parameter"]}}, defaults: {"source":"database"} }), workflowUrl: resolveSchema({ parameters, schema: stringOrExpression, required: false, displayOptions: {"show":{"source":["url"]}}, defaults: {"source":"database"} }), mode: z.union([z.literal('once'), z.literal('each')]).optional(), options: z.object({ waitForSubWorkflow: booleanOrExpression.optional() }).optional(), }); // Return combined config schema return z.object({ parameters: parametersSchema.optional(), }); };