Intermediate
How to configure execution data tagging on n8n
Quick Answer
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
1
Enable execution data tagging in environment configuration
For self-hosted instances, add the following environment variables to your n8n configuration:
For cloud instances, access Settings > Environment and enable Save execution data.
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.
Tip
Restart your n8n instance after changing environment variables for the settings to take effect.
2
Configure workflow-level execution tags
Open your workflow in the n8n editor and click on Workflow > Settings. Navigate to the Executions tab and enable Save execution data. In the Tags section, add custom tags by clicking Add Tag and entering tag names like
production, critical, or monitoring.Tip
Use consistent tag naming conventions across workflows to improve organization and filtering.
3
Set up dynamic tagging with expressions
In the workflow settings Tags field, use n8n expressions to create dynamic tags:
These expressions will automatically generate tags based on workflow data, dates, or execution context.
{{ $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.
Tip
Test dynamic tag expressions with a manual execution to ensure they generate the expected tag values.
4
Configure node-level execution metadata
Select any node in your workflow and go to the Settings tab. Enable Always Output Data and Continue On Fail if needed. In the Notes section, add descriptive metadata that will be included with execution data. Use the Set node to add custom metadata fields like
execution_category or business_unit.5
Enable execution data filtering and search
Navigate to Executions in the main menu. Use the Filter button to access advanced filtering options. Configure filters by Status, Workflow, Tags, and Date Range. Save frequently used filter combinations as Saved Filters for quick access.
Tip
Create saved filters for common scenarios like 'Failed Production Executions' or 'Today's Critical Workflows'.
6
Set up execution data retention policies
In Settings > Log Streaming, configure data retention by setting
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.Tip
Balance retention duration with storage costs - keep critical tagged executions longer than routine ones.
7
Configure webhook and API access for tagged data
Create a webhook node or use the n8n API to access execution data programmatically. Use the endpoint
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.Tip
Use API access to integrate execution data with external monitoring and alerting systems.
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.
Ready to get started with n8n?
Put this tutorial into practice. Visit n8n and follow the steps above.
Visit n8n →