diff --git a/roles/n8n/defaults/main.yml b/roles/n8n/defaults/main.yml index af6953a..db9f08b 100644 --- a/roles/n8n/defaults/main.yml +++ b/roles/n8n/defaults/main.yml @@ -49,3 +49,7 @@ n8n_public_url: http://{{ inventory_hostname }}:{{ n8n_port }}/ # This is recommended most of the time, but there are cases where you might want n8n to # be able to write under /usr n8n_protect_system: True + +# How long to keep workflow execution logs in the DB before pruning them. +# The value is in hours. Default is 90 days +n8n_data_max_age: 2160 diff --git a/roles/n8n/templates/env.j2 b/roles/n8n/templates/env.j2 index d3bb219..c7ac527 100644 --- a/roles/n8n/templates/env.j2 +++ b/roles/n8n/templates/env.j2 @@ -3,3 +3,5 @@ N8N_USER_FOLDER={{ n8n_root_dir }}/data WEBHOOK_TUNNEL_URL={{ n8n_public_url }} VUE_APP_URL_BASE_API={{ n8n_public_url }} N8N_ENCRYPTION_KEY={{ n8n_secret_key | quote }} +EXECUTIONS_DATA_PRUNE=true +EXECUTIONS_DATA_MAX_AGE={{ n8n_data_max_age }}