How to configure execution data tagging on n8n
Execution data tagging in n8n allows you to categorize and organize workflow executions with custom labels for better tracking and analysis. This feature is configured through environment variables and workflow settings to enable metadata collection and filtering.
Prerequisites
- n8n instance running (self-hosted or cloud)
- Administrative access to n8n instance
- Basic understanding of n8n workflows
- Database access for self-hosted instances
Step-by-Step Instructions
Enable execution data tagging in environment configuration
N8N_EXECUTIONS_DATA_SAVE_ON_ERROR=allN8N_EXECUTIONS_DATA_SAVE_ON_SUCCESS=allN8N_EXECUTIONS_DATA_SAVE_MANUAL_EXECUTIONS=trueN8N_EXECUTIONS_DATA_PRUNE=trueFor cloud instances, access Settings > Environment and enable Save execution data.
Configure workflow-level execution tags
production, critical, or monitoring.Set up dynamic tagging with expressions
{{ $workflow.name }}-{{ new Date().toISOString().split('T')[0] }}{{ $node["Trigger"].json["environment"] }}status-{{ $execution.mode }}These expressions will automatically generate tags based on workflow data, dates, or execution context.
Configure node-level execution metadata
execution_category or business_unit.Enable execution data filtering and search
Set up execution data retention policies
N8N_EXECUTIONS_DATA_MAX_AGE environment variable (in hours). For database cleanup, set N8N_EXECUTIONS_DATA_PRUNE_MAX_AGE and N8N_EXECUTIONS_DATA_PRUNE_MAX_COUNT. Enable Automatic Cleanup to maintain optimal database performance.Configure webhook and API access for tagged data
GET /executions with query parameters like ?tags=production&status=error. Set up authentication with API Keys in Settings > API Keys and configure appropriate permissions for execution data access.Common Issues & Troubleshooting
Tags are not appearing in execution history
Verify that Save execution data is enabled in both workflow settings and instance configuration. Check that the N8N_EXECUTIONS_DATA_SAVE_ON_SUCCESS environment variable is set to all.
Dynamic tag expressions are not evaluating correctly
Ensure expressions use proper n8n syntax with double curly braces {{ }}. Test expressions in the Expression Editor and verify that referenced nodes and data paths exist in your workflow.
Execution data consuming too much database storage
Configure data pruning by setting N8N_EXECUTIONS_DATA_PRUNE_MAX_AGE to limit retention period. Enable selective saving by setting N8N_EXECUTIONS_DATA_SAVE_ON_SUCCESS to none for non-critical workflows.
Unable to filter executions by custom tags
Refresh the executions page and clear browser cache. Verify tags were saved correctly by checking individual execution details. Ensure tag names don't contain special characters or excessive whitespace.