Add a check condition for a loop in n8n
n8n template #1130Summary
Use templateThis workflow demonstrates the use of $runIndex expression. It demonstrates how the expression can be used to avoid an infinite loop. The workflow will create 5 Tweets with the content 'Hello from n8n!'. You can use this workflow by replacing the Twitter node with any other node(s) and updating the condition in the IF node.
How to set it up
- Open template #1130 on n8n.io and click Use for free, or copy the template JSON and paste it onto an empty canvas in n8n.
- Create a credential under Credentials → Add credential: X (Formerly Twitter). Then open each of those nodes and pick the credential.
- Click Execute workflow and step through each node's output to confirm the data looks right.
- Toggle the workflow to Active so its trigger runs on its own.
Hand off to your agent
Prompt
Help me set up the n8n workflow "Add a check condition for a loop in n8n" (https://n8n.io/workflows/1130). It uses: X (Formerly Twitter). Import the template JSON into my n8n instance, list every credential I need to create, and walk me through testing it.
Paste into Claude Code and it will do the rest.
Apps and nodes
Questions
Yes. Harshil Agrawal published it free on n8n.io as a verified creator, and it has 9,551 views. It runs on n8n Cloud or a self-hosted n8n instance.
X (Formerly Twitter). The other 0 nodes are built into n8n.
Similar workflows
NameViews
- ✨🤖Automate Multi-Platform Social Media Content Creation with AI205K
- ✨🩷Automated Social Media Content Publishing Factory + System Prompt Composition55K
- Hacker News to Video Content47K
- AI-Powered Multi-Social Media Post Automation: Google Trends & Perplexity AI41K
- Publish WordPress Posts to Social Media X, Facebook, LinkedIn, Instagram with AI32K
- Twitter Virtual AI Influencer28K
- 🤖 AI content generation for Auto Service 🚘 Automate your social media📲!27K
- Social Media Content Generator And Publisher | X, Linkedin19K