refactor(core): Include execution progress in save settings (no-changelog) (#7769)
This commit is contained in:
@@ -2,14 +2,19 @@ import config from '@/config';
|
||||
import type { IWorkflowSettings } from 'n8n-workflow';
|
||||
|
||||
/**
|
||||
* Return whether a workflow execution is configured to be saved or not,
|
||||
* for error executions, success executions, and manual executions.
|
||||
* Return whether a workflow execution is configured to be saved or not:
|
||||
*
|
||||
* - `error`: Whether to save failed executions in production.
|
||||
* - `success`: Whether to successful executions in production.
|
||||
* - `manual`: Whether to save successful or failed manual executions.
|
||||
* - `progress`: Whether to save execution progress, i.e. after each node's execution.
|
||||
*/
|
||||
export function toSaveSettings(workflowSettings: IWorkflowSettings = {}) {
|
||||
const DEFAULTS = {
|
||||
ERROR: config.getEnv('executions.saveDataOnError'),
|
||||
SUCCESS: config.getEnv('executions.saveDataOnSuccess'),
|
||||
MANUAL: config.getEnv('executions.saveDataManualExecutions'),
|
||||
PROGRESS: config.getEnv('executions.saveExecutionProgress'),
|
||||
};
|
||||
|
||||
return {
|
||||
@@ -19,6 +24,13 @@ export function toSaveSettings(workflowSettings: IWorkflowSettings = {}) {
|
||||
success: workflowSettings.saveDataSuccessExecution
|
||||
? workflowSettings.saveDataSuccessExecution !== 'none'
|
||||
: DEFAULTS.SUCCESS !== 'none',
|
||||
manual: workflowSettings?.saveManualExecutions ?? DEFAULTS.MANUAL,
|
||||
manual:
|
||||
workflowSettings === undefined || workflowSettings.saveManualExecutions === 'DEFAULT'
|
||||
? DEFAULTS.MANUAL
|
||||
: workflowSettings.saveManualExecutions ?? DEFAULTS.MANUAL,
|
||||
progress:
|
||||
workflowSettings === undefined || workflowSettings.saveExecutionProgress === 'DEFAULT'
|
||||
? DEFAULTS.PROGRESS
|
||||
: workflowSettings.saveExecutionProgress ?? DEFAULTS.PROGRESS,
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user