mirror of
https://github.com/n8n-io/n8n.git
synced 2026-06-04 18:49:20 +02:00
38 lines
1.5 KiB
TypeScript
38 lines
1.5 KiB
TypeScript
import { z } from 'zod';
|
|
|
|
import { Config, Env } from '../decorators';
|
|
|
|
const callerPolicySchema = z.enum(['any', 'none', 'workflowsFromAList', 'workflowsFromSameOwner']);
|
|
type CallerPolicy = z.infer<typeof callerPolicySchema>;
|
|
|
|
@Config
|
|
export class WorkflowsConfig {
|
|
/** Default name suggested when creating a new workflow. */
|
|
@Env('WORKFLOWS_DEFAULT_NAME')
|
|
defaultName: string = 'My workflow';
|
|
|
|
/** Default policy for which workflows are allowed to call this workflow (for example, same owner, any, none). */
|
|
@Env('N8N_WORKFLOW_CALLER_POLICY_DEFAULT_OPTION', callerPolicySchema)
|
|
callerPolicyDefaultOption: CallerPolicy = 'workflowsFromSameOwner';
|
|
|
|
/** Number of workflows to activate in parallel during startup. */
|
|
@Env('N8N_WORKFLOW_ACTIVATION_BATCH_SIZE')
|
|
activationBatchSize: number = 1;
|
|
|
|
/** Whether to build and maintain workflow dependency indexes (for example, for subworkflow callers). */
|
|
@Env('N8N_WORKFLOWS_INDEXING_ENABLED')
|
|
indexingEnabled: boolean = true;
|
|
|
|
/** Number of workflows to process per batch during dependency indexing on startup. Defaults to 10. */
|
|
@Env('N8N_WORKFLOW_INDEX_BATCH_SIZE')
|
|
indexingBatchSize: number = 10;
|
|
|
|
/** Whether to use the workflow publication service. Still under development. */
|
|
@Env('N8N_USE_WORKFLOW_PUBLICATION_SERVICE')
|
|
useWorkflowPublicationService: boolean = false;
|
|
|
|
/** Whether to disable automatic workflow saving in the editor */
|
|
@Env('N8N_WORKFLOWS_AUTOSAVE_DISABLED')
|
|
autosaveDisabled: boolean = false;
|
|
}
|