n8n Workflow

Filtering And Branching Data

This n8n workflow automates tasks and integrates with various services. Filtering And Branching Data - ready to import and run in your n8n instance.

n8n workflow.json

About This Script

This n8n workflow automates tasks and integrates with various services. Filtering And Branching Data - ready to import and run in your n8n instance.
Features:
  • Conditional logic and branching
Source Code
{
    "nodes": [
        {
            "name": "On clicking 'execute'",
            "type": "n8n-nodes-base.manualTrigger",
            "position": [
                20,
                720
            ],
            "parameters": [],
            "typeVersion": 1,
            "id": "9eed32f9-bcd6-4255-a150-d44e3de2c692"
        },
        {
            "name": "Customer Datastore",
            "type": "n8n-nodes-base.n8nTrainingCustomerDatastore",
            "position": [
                220,
                720
            ],
            "parameters": {
                "operation": "getAllPeople"
            },
            "typeVersion": 1,
            "id": "4c8929e6-eb85-4c53-b06c-001b10e868d5"
        },
        {
            "name": "Note",
            "type": "n8n-nodes-base.stickyNote",
            "position": [
                500,
                600
            ],
            "parameters": {
                "width": 520,
                "height": 280,
                "content": "Configuration note: update with your credentials or endpoint.",
                "color": "#FFF59D"
            },
            "typeVersion": 1,
            "id": "e006d7ab-924c-4d6f-b1cd-db7d69831dd8"
        },
        {
            "name": "Note1",
            "type": "n8n-nodes-base.stickyNote",
            "position": [
                500,
                920
            ],
            "parameters": {
                "width": 520,
                "height": 360,
                "content": "Configuration note: update with your credentials or endpoint.",
                "color": "#FFF59D"
            },
            "typeVersion": 1,
            "id": "67a52db4-7985-41df-bba0-d1938a8f3250"
        },
        {
            "name": "Note2",
            "type": "n8n-nodes-base.stickyNote",
            "position": [
                500,
                300
            ],
            "parameters": {
                "width": 520,
                "height": 260,
                "content": "Configuration note: update with your credentials or endpoint.",
                "color": "#FFF59D"
            },
            "typeVersion": 1,
            "id": "c71f8e98-88c9-407e-b71a-65caf106df03"
        },
        {
            "name": "Note3",
            "type": "n8n-nodes-base.stickyNote",
            "position": [
                -520,
                660
            ],
            "parameters": {
                "width": 480,
                "height": 240,
                "content": "Configuration note: update with your credentials or endpoint.",
                "color": "#FFF59D"
            },
            "typeVersion": 1,
            "id": "03a1dd5c-a9d6-4e3d-a434-469475ba53ed"
        },
        {
            "name": "Country equals US",
            "type": "n8n-nodes-base.if",
            "position": [
                540,
                420
            ],
            "parameters": {
                "conditions": {
                    "string": [
                        {
                            "value1": "={{$json[\"country\"]}}",
                            "value2": "US"
                        }
                    ]
                }
            },
            "typeVersion": 1,
            "id": "0927eb10-100d-44e8-b8f8-c6daec4dbd87"
        },
        {
            "name": "Country is empty or Name contains 'Max'",
            "type": "n8n-nodes-base.if",
            "position": [
                540,
                720
            ],
            "parameters": {
                "conditions": {
                    "string": [
                        {
                            "value1": "={{$json[\"country\"]}}",
                            "operation": "isEmpty"
                        },
                        {
                            "value1": "={{$json[\"name\"]}}",
                            "value2": "Max",
                            "operation": "contains"
                        }
                    ]
                },
                "combineOperation": "any"
            },
            "typeVersion": 1,
            "id": "4dcbf923-07bd-449e-a5ea-61e8388df2b5"
        },
        {
            "name": "Country based branching",
            "type": "n8n-nodes-base.switch",
            "position": [
                540,
                1120
            ],
            "parameters": {
                "rules": {
                    "rules": [
                        {
                            "value2": "US"
                        },
                        {
                            "output": 1,
                            "value2": "CO"
                        },
                        {
                            "output": 2,
                            "value2": "UK"
                        }
                    ]
                },
                "value1": "={{$json[\"country\"]}}",
                "dataType": "string",
                "fallbackOutput": 3
            },
            "typeVersion": 1,
            "id": "6ec586b8-60f8-4f2b-99f8-ba812d107eff"
        }
    ],
    "connections": {
        "Customer Datastore": {
            "main": [
                [
                    {
                        "node": "Country is empty or Name contains 'Max'",
                        "type": "main",
                        "index": 0
                    },
                    {
                        "node": "Country based branching",
                        "type": "main",
                        "index": 0
                    },
                    {
                        "node": "Country equals US",
                        "type": "main",
                        "index": 0
                    }
                ]
            ]
        },
        "On clicking 'execute'": {
            "main": [
                [
                    {
                        "node": "Customer Datastore",
                        "type": "main",
                        "index": 0
                    }
                ]
            ]
        }
    },
    "n8n_version": "1.5.0"
}
Requirements
n8n instance, API credentials for connected services
Tags
#n8n #automation #workflow
Quick Actions
More in n8n Workflows