Conditional Data Generation with n8n
detail.loadingPreview
This workflow demonstrates conditional data generation based on an 'id' value using an IF node.
About This Workflow
This n8n workflow starts with a manual trigger. A Function node then generates two distinct data items, each with an 'id' of either 0 or 1. An IF node evaluates the 'id' of each incoming item. Based on whether the 'id' is equal to 0, the workflow branches to either a 'Set' node (for id=0) or a 'Set1' node (for id=1). Both 'Set' nodes assign a 'name' property to the data, with different values ('n8n' and 'nodemation' respectively).
Key Features
- Manual Trigger: Initiates the workflow manually.
- Function Node: Dynamically generates data items with an 'id' field.
- IF Node: Implements conditional logic based on the 'id' value.
- Set Nodes: Assigns specific data values based on the conditional branching.
How To Use
- Click the 'On clicking 'execute'' node to start the workflow.
- Observe how the 'Function' node creates two items.
- The 'IF' node will evaluate the 'id' of each item.
- For the item with
id: 0, the workflow will proceed to the 'Set' node, addingname: 'n8n'. - For the item with
id: 1, the workflow will proceed to the 'Set1' node, addingname: 'nodemation'. - Inspect the output of the 'Set' and 'Set1' nodes to see the conditionally generated data.
Apps Used
Workflow JSON
{
"id": "37272c06-aa77-4608-ae10-c8479085a769",
"name": "Conditional Data Generation with n8n",
"nodes": 20,
"category": "Automation",
"status": "active",
"version": "1.0.0"
}Note: This is a sample preview. The full workflow JSON contains node configurations, credentials placeholders, and execution logic.
Get This Workflow
ID: 37272c06-aa77...
About the Author
Free n8n Workflows Official
System Admin
The official repository for verified enterprise-grade workflows.
Statistics
Related Workflows
Discover more workflows you might like
Automated Google Drive Backup for n8n Workflows
Automatically back up n8n workflows to Google Drive on a schedule.
Generate Structured Metadata for Standup Bot
This workflow generates structured configuration metadata for a standup bot, saving it as a JSON file.
Supply Chain Delay Monitor
Automated monitoring and logging of supply chain delays using a webhook, text processing, embeddings, and a vector store.