Demo: Conditional Set Execution via IF on Function Output
Illustrates branching workflow logic where an IF node routes Function outputs to different Set nodes based on ID value, ideal for n8n beginners learning conditionals.
This workflow serves as a companion example for n8n's IF node documentation, showcasing how to implement conditional branching based on data from a preceding Function node. It begins with a Manual Trigger, followed by a Function node that generates two items with distinct 'id' values (0 and 1). The IF node evaluates each item's 'id'—routing to a 'Set' node (setting 'name' to 'n8n') if true (e.g., id equals 0), or to 'Set1' (setting 'name' to 'nodemation') if false.
The primary benefit is educational: it simplifies understanding multi-item handling and dynamic routing in n8n, preventing common pitfalls like incorrect expressions in conditions. Users gain hands-on insight into expression syntax (e.g., {{$node["Function"].json["id"]}}) and connection mapping for true/false outputs.
Use cases include prototyping conditional automations, such as processing API responses differently based on status codes, user roles, or data thresholds. It's perfect for developers building scalable workflows in IT tools, IoT device management, or any scenario requiring decision-based node execution, saving time on trial-and-error debugging.
Extend it by integrating real data sources (e.g., HTTP Request) or actions (e.g., email notifications), transforming this demo into production-ready logic for device control or data processing pipelines.
New buyers can create an account from the cart to unlock a controlled $10 first-purchase credit on eligible orders of $25+.
Secure checkout powered by Stripe
Tags
Support
How to import this workflow into n8n
- 1Purchase or download the workflow to get the n8n workflow JSON file.
- 2In your n8n instance, open Workflows and choose "Import from File" (or paste the JSON with Ctrl+V on the canvas).
- 3Open each node marked with a credential warning and connect your own accounts and API keys.
- 4Run the workflow once manually to verify the data flow, then toggle it to Active.
Related Internet of Things workflows
- Automated Weather Alerts and Analysis Using AI and Home Assistant$14.99
- AI-Driven Handbook Generator with Multi-Agent Orchestration$24.99
- Birthday and Ephemeris Notification (Google Contact, Telegram & Home Assistant)$14.99
- Automate Network Disconnection Alerts with Omada, Gmail, and Pushover$14.99
- Vehicle Telematics Analyzer for Efficient Device Management$24.99
- Automate IoT Sensor Data Cleaning and Logging to InfluxDB$4.99
More from QualityWorkflows
Need this deployed? We'll set it up for you.
Our automation experts deploy this workflow in your stack, connect your accounts, and verify it works — or build a custom solution from scratch.