mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 01:56:46 +00:00
refactor(core): Port workflows config (no-changelog) (#10173)
This commit is contained in:
20
packages/@n8n/config/src/configs/workflows.ts
Normal file
20
packages/@n8n/config/src/configs/workflows.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
import { Config, Env } from '../decorators';
|
||||
|
||||
@Config
|
||||
export class WorkflowsConfig {
|
||||
/** Default name for workflow */
|
||||
@Env('WORKFLOWS_DEFAULT_NAME')
|
||||
readonly defaultName: string = 'My workflow';
|
||||
|
||||
/** Show onboarding flow in new workflow */
|
||||
@Env('N8N_ONBOARDING_FLOW_DISABLED')
|
||||
readonly onboardingFlowDisabled: boolean = false;
|
||||
|
||||
/** Default option for which workflows may call the current workflow */
|
||||
@Env('N8N_WORKFLOW_CALLER_POLICY_DEFAULT_OPTION')
|
||||
readonly callerPolicyDefaultOption:
|
||||
| 'any'
|
||||
| 'none'
|
||||
| 'workflowsFromAList'
|
||||
| 'workflowsFromSameOwner' = 'workflowsFromSameOwner';
|
||||
}
|
||||
@@ -9,6 +9,7 @@ import { TemplatesConfig } from './configs/templates';
|
||||
import { EventBusConfig } from './configs/event-bus';
|
||||
import { NodesConfig } from './configs/nodes';
|
||||
import { ExternalStorageConfig } from './configs/external-storage';
|
||||
import { WorkflowsConfig } from './configs/workflows';
|
||||
|
||||
@Config
|
||||
class UserManagementConfig {
|
||||
@@ -47,4 +48,7 @@ export class GlobalConfig {
|
||||
|
||||
@Nested
|
||||
readonly externalStorage: ExternalStorageConfig;
|
||||
|
||||
@Nested
|
||||
readonly workflows: WorkflowsConfig;
|
||||
}
|
||||
|
||||
@@ -135,6 +135,11 @@ describe('GlobalConfig', () => {
|
||||
},
|
||||
},
|
||||
},
|
||||
workflows: {
|
||||
defaultName: 'My workflow',
|
||||
onboardingFlowDisabled: false,
|
||||
callerPolicyDefaultOption: 'workflowsFromSameOwner',
|
||||
},
|
||||
};
|
||||
|
||||
it('should use all default values when no env variables are defined', () => {
|
||||
|
||||
Reference in New Issue
Block a user