Add a check condition for a loop in n8n — n8n Workflow

Low complexity Trigger4 nodes📣 Marketing👁 9,551 viewsby Harshil Agrawal

Overview

This 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.

Nodes used

X (Formerly Twitter)

Workflow Preview

O
On clicking 'execute'
I
IF
N
NoOp
Twitter
4 nodes4 edges

How it Works

  1. 1

    Trigger

    The workflow starts with a trigger trigger.

  2. 2

    Process

    Data flows through 4 nodes, connecting if, manualtrigger, twitter.

  3. 3

    Output

    The workflow completes its automation and delivers the result to the configured destination.

Node Details (4)

X

X (Formerly Twitter)

twitter

#1

How to Import This Workflow

  1. 1Click Download JSON button on the right to save the workflow file.
  2. 2Open your n8n instance. Go to Workflows → New → Import from file.
  3. 3Select the downloaded add-a-check-condition-for-a-loop-in-n8n file and click Import.
  4. 4Set up credentials for each service node (API keys, OAuth, etc.).
  5. 5Click Test Workflow to verify everything works, then activate it.

Or paste directly in n8n → Import from JSON:

{ "name": "Add a check condition for a loop in n8n", "nodes": [...], ...}

Integrations

ifmanualtriggertwitter

Get This Workflow

Download and import in one click

Download JSONView on n8n.io
Nodes4
Complexitylow
Triggertrigger
Views9,551
CategoryMarketing

Created by

Harshil Agrawal

Harshil Agrawal

@harshil1712

Tags

ifmanualtriggertwitter

New to n8n?

n8n is a free, open-source workflow automation tool. Self-host it or use the cloud version.

Get n8n Free →