AutomationFlowsData & Sheets › Route Reaction

Route Reaction

Route_Reaction. Uses executeWorkflowTrigger, postgres, stopAndError. Event-driven trigger; 11 nodes.

Event trigger★★★★☆ complexity11 nodesExecute Workflow TriggerPostgresStop And Error
Data & Sheets Trigger: Event Nodes: 11 Complexity: ★★★★☆ Added:

This workflow follows the Execute Workflow Trigger → Postgres recipe pattern — see all workflows that pair these two integrations.

The workflow JSON

Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →

Download .json
{
  "updatedAt": "2025-12-24T08:53:16.069Z",
  "createdAt": "2025-12-23T09:30:31.551Z",
  "id": "TiwH9iJRRV8ZRtrs",
  "name": "Route_Reaction",
  "description": null,
  "active": false,
  "isArchived": false,
  "nodes": [
    {
      "parameters": {
        "inputSource": "passthrough"
      },
      "type": "n8n-nodes-base.executeWorkflowTrigger",
      "typeVersion": 1.1,
      "position": [
        -380,
        480
      ],
      "id": "trigger-node",
      "name": "ReceiveEvent"
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict",
            "version": 1
          },
          "conditions": [
            {
              "id": "is-add-reaction",
              "leftValue": "={{ $json.ctx.event.action }}",
              "rightValue": "add",
              "operator": {
                "type": "string",
                "operation": "equals"
              }
            }
          ],
          "combinator": "and"
        },
        "options": {}
      },
      "type": "n8n-nodes-base.if",
      "typeVersion": 2,
      "position": [
        -160,
        480
      ],
      "id": "check-action",
      "name": "IsAddReaction?"
    },
    {
      "parameters": {
        "operation": "executeQuery",
        "query": "SELECT value FROM config WHERE key = 'emoji_mapping';",
        "options": {}
      },
      "type": "n8n-nodes-base.postgres",
      "typeVersion": 2.4,
      "position": [
        60,
        480
      ],
      "id": "get-emoji-config",
      "name": "GetEmojiConfig",
      "credentials": {
        "postgres": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "jsCode": "// Determine route based on emoji_mapping config\nconst ctx = $('ReceiveEvent').first().json.ctx;\nconst emoji = ctx.event.emoji;\n\n// Parse config - Postgres returns JSON as string\nconst rawValue = $json.value;\nconst config = typeof rawValue === 'string' ? JSON.parse(rawValue) : (rawValue || {});\n\n// Extraction emojis (number selections + dismiss)\n// These are hardcoded because they're tied to display order logic\nconst extractionEmojis = ['1\ufe0f\u20e3', '2\ufe0f\u20e3', '3\ufe0f\u20e3', '4\ufe0f\u20e3', '5\ufe0f\u20e3', '6\ufe0f\u20e3', '7\ufe0f\u20e3', '8\ufe0f\u20e3', '9\ufe0f\u20e3', '\ud83d\udd1f', '\u274c'];\n\n// Info emojis (show details about the projection)\n// \u2754 = simple view (just projections)\n// \u2753 = detailed view (full prompts, timing)\nconst infoEmojis = ['\u2753', '\u2754'];\n\n// Quality rating emojis (rate projection quality)\nconst qualityEmojis = ['\ud83d\udc4d', '\ud83d\udc4e'];\n\n// Get correction emojis from config (type corrections + void)\nconst corrections = config.corrections || [];\n\n// Get todo status emojis from config\nconst statusEmojis = Object.keys(config.status || {});\n\n// Determine route\nlet route = 'unknown';\n\nif (extractionEmojis.includes(emoji)) {\n  route = 'extraction';\n} else if (infoEmojis.includes(emoji)) {\n  route = 'info';\n} else if (qualityEmojis.includes(emoji)) {\n  route = 'quality';\n} else if (corrections.includes(emoji)) {\n  route = 'correction';\n} else if (statusEmojis.includes(emoji)) {\n  route = 'todo_status';\n}\n\nreturn {\n  json: {\n    ctx,\n    route,\n    emoji,\n    config\n  }\n};",
        "mode": "runOnceForEachItem"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        280,
        480
      ],
      "id": "determine-route",
      "name": "DetermineRoute"
    },
    {
      "parameters": {
        "rules": {
          "values": [
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "strict",
                  "version": 3
                },
                "conditions": [
                  {
                    "id": "is-extraction",
                    "leftValue": "={{ $json.route }}",
                    "rightValue": "extraction",
                    "operator": {
                      "type": "string",
                      "operation": "equals"
                    }
                  }
                ],
                "combinator": "and"
              },
              "renameOutput": true,
              "outputKey": "Extraction"
            },
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "strict",
                  "version": 3
                },
                "conditions": [
                  {
                    "id": "is-info",
                    "leftValue": "={{ $json.route }}",
                    "rightValue": "info",
                    "operator": {
                      "type": "string",
                      "operation": "equals"
                    }
                  }
                ],
                "combinator": "and"
              },
              "renameOutput": true,
              "outputKey": "Info"
            },
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "strict",
                  "version": 3
                },
                "conditions": [
                  {
                    "id": "is-quality",
                    "leftValue": "={{ $json.route }}",
                    "rightValue": "quality",
                    "operator": {
                      "type": "string",
                      "operation": "equals"
                    }
                  }
                ],
                "combinator": "and"
              },
              "renameOutput": true,
              "outputKey": "Quality"
            },
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "strict",
                  "version": 3
                },
                "conditions": [
                  {
                    "id": "is-correction",
                    "leftValue": "={{ $json.route }}",
                    "rightValue": "correction",
                    "operator": {
                      "type": "string",
                      "operation": "equals"
                    }
                  }
                ],
                "combinator": "and"
              },
              "renameOutput": true,
              "outputKey": "Correction"
            },
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "strict",
                  "version": 3
                },
                "conditions": [
                  {
                    "id": "is-todo-status",
                    "leftValue": "={{ $json.route }}",
                    "rightValue": "todo_status",
                    "operator": {
                      "type": "string",
                      "operation": "equals"
                    }
                  }
                ],
                "combinator": "and"
              },
              "renameOutput": true,
              "outputKey": "Todo Status"
            }
          ]
        },
        "options": {
          "fallbackOutput": "extra"
        }
      },
      "type": "n8n-nodes-base.switch",
      "typeVersion": 3.4,
      "position": [
        500,
        480
      ],
      "id": "route-by-emoji",
      "name": "RouteByEmoji"
    },
    {
      "parameters": {
        "workflowId": {
          "__rl": true,
          "value": "dzbXvPNPoYdpaXGT",
          "mode": "list",
          "cachedResultName": "Save_Extraction",
          "cachedResultUrl": "/workflow/dzbXvPNPoYdpaXGT"
        },
        "workflowInputs": {
          "mappingMode": "defineBelow",
          "value": {}
        },
        "options": {}
      },
      "type": "n8n-nodes-base.executeWorkflow",
      "typeVersion": 1.3,
      "position": [
        720,
        320
      ],
      "id": "save-extraction",
      "name": "SaveExtraction"
    },
    {
      "parameters": {
        "workflowId": {
          "__rl": true,
          "value": "baPcss9BKwIpEZQU",
          "mode": "list",
          "cachedResultName": "Handle_Correction",
          "cachedResultUrl": "/workflow/baPcss9BKwIpEZQU"
        },
        "workflowInputs": {
          "mappingMode": "defineBelow",
          "value": {}
        },
        "options": {
          "waitForSubWorkflow": false
        }
      },
      "type": "n8n-nodes-base.executeWorkflow",
      "typeVersion": 1.3,
      "position": [
        720,
        480
      ],
      "id": "handle-correction",
      "name": "HandleCorrection"
    },
    {
      "parameters": {
        "workflowId": {
          "__rl": true,
          "value": "NCt9DcriuZwLwFLA",
          "mode": "list",
          "cachedResultName": "Handle_Todo_Status",
          "cachedResultUrl": "/workflow/NCt9DcriuZwLwFLA"
        },
        "workflowInputs": {
          "mappingMode": "defineBelow",
          "value": {}
        },
        "options": {
          "waitForSubWorkflow": false
        }
      },
      "type": "n8n-nodes-base.executeWorkflow",
      "typeVersion": 1.3,
      "position": [
        720,
        640
      ],
      "id": "handle-todo-status",
      "name": "HandleTodoStatus"
    },
    {
      "parameters": {
        "errorMessage": "=Unknown reaction emoji: {{ $json.emoji }}"
      },
      "type": "n8n-nodes-base.stopAndError",
      "typeVersion": 1,
      "position": [
        720,
        1040
      ],
      "id": "unknown-emoji-error",
      "name": "UnknownEmojiError"
    },
    {
      "parameters": {
        "workflowId": {
          "__rl": true,
          "value": "wVpslhMBnrsgDaOR",
          "mode": "list",
          "cachedResultName": "Show_Projection_Details",
          "cachedResultUrl": "/workflow/wVpslhMBnrsgDaOR"
        },
        "workflowInputs": {
          "mappingMode": "defineBelow",
          "value": {}
        },
        "options": {
          "waitForSubWorkflow": false
        }
      },
      "type": "n8n-nodes-base.executeWorkflow",
      "typeVersion": 1.3,
      "position": [
        720,
        800
      ],
      "id": "show-projection-details",
      "name": "ShowProjectionDetails"
    },
    {
      "parameters": {
        "workflowId": {
          "__rl": true,
          "value": "887fJOHvjP78PQoO",
          "mode": "list",
          "cachedResultName": "Handle_Quality_Rating",
          "cachedResultUrl": "/workflow/887fJOHvjP78PQoO"
        },
        "workflowInputs": {
          "mappingMode": "defineBelow",
          "value": {}
        },
        "options": {
          "waitForSubWorkflow": false
        }
      },
      "type": "n8n-nodes-base.executeWorkflow",
      "typeVersion": 1.3,
      "position": [
        720,
        880
      ],
      "id": "handle-quality-rating",
      "name": "HandleQualityRating"
    }
  ],
  "connections": {
    "ReceiveEvent": {
      "main": [
        [
          {
            "node": "IsAddReaction?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "IsAddReaction?": {
      "main": [
        [
          {
            "node": "GetEmojiConfig",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "GetEmojiConfig": {
      "main": [
        [
          {
            "node": "DetermineRoute",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "DetermineRoute": {
      "main": [
        [
          {
            "node": "RouteByEmoji",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "RouteByEmoji": {
      "main": [
        [
          {
            "node": "SaveExtraction",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "ShowProjectionDetails",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "HandleQualityRating",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "HandleCorrection",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "HandleTodoStatus",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "UnknownEmojiError",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {
    "callerPolicy": "workflowsFromSameOwner",
    "errorWorkflow": "NOJ7FqVhVLqw0n8D",
    "availableInMCP": false,
    "executionOrder": "v1"
  },
  "staticData": null,
  "meta": null,
  "versionId": "2ea6724d-22a9-4d8d-8cca-7a4d07641ec7",
  "activeVersionId": null,
  "versionCounter": 186,
  "triggerCount": 0,
  "shared": [
    {
      "updatedAt": "2025-12-23T09:30:31.551Z",
      "createdAt": "2025-12-23T09:30:31.551Z",
      "role": "workflow:owner",
      "workflowId": "TiwH9iJRRV8ZRtrs",
      "projectId": "erM3nntdLL53noWi",
      "project": {
        "updatedAt": "2025-12-23T09:23:39.658Z",
        "createdAt": "2025-12-23T09:16:56.460Z",
        "id": "erM3nntdLL53noWi",
        "name": "Chris Irineo <chriskevini@gmail.com>",
        "type": "personal",
        "icon": null,
        "description": null,
        "projectRelations": [
          {
            "updatedAt": "2025-12-23T09:16:56.460Z",
            "createdAt": "2025-12-23T09:16:56.460Z",
            "userId": "2a851a2d-b7e5-4b3c-aefb-6eaaa79e0659",
            "projectId": "erM3nntdLL53noWi",
            "user": {
              "updatedAt": "2025-12-24T08:40:46.063Z",
              "createdAt": "2025-12-23T09:16:54.881Z",
              "id": "2a851a2d-b7e5-4b3c-aefb-6eaaa79e0659",
              "email": "chriskevini@gmail.com",
              "firstName": "Chris",
              "lastName": "Irineo",
              "personalizationAnswers": {
                "version": "v4",
                "personalization_survey_submitted_at": "2025-12-23T09:23:43.723Z",
                "personalization_survey_n8n_version": "1.123.5"
              },
              "settings": {
                "userActivated": true,
                "firstSuccessfulWorkflowId": "CgUAxK0i4YhrZ2Wp",
                "userActivatedAt": 1766487000077,
                "easyAIWorkflowOnboarded": true
              },
              "disabled": false,
              "mfaEnabled": false,
              "lastActiveAt": "2025-12-24",
              "isPending": false
            }
          }
        ]
      }
    }
  ],
  "tags": [],
  "activeVersion": null
}

Credentials you'll need

Each integration node will prompt for credentials when you import. We strip credential IDs before publishing — you'll add your own.

Pro

For the full experience including quality scoring and batch install features for each workflow upgrade to Pro

About this workflow

Route_Reaction. Uses executeWorkflowTrigger, postgres, stopAndError. Event-driven trigger; 11 nodes.

Source: https://github.com/chriskevini/kairon/blob/ab924f228ceb22522b9a4dfa1ab4589eb86273ad/n8n-workflows/Route_Reaction.json — original creator credit. Request a take-down →

More Data & Sheets workflows → · Browse all categories →

Related workflows

Workflows that share integrations, category, or trigger type with this one. All free to copy and import.

Data & Sheets

Reagendamiento_v2. Uses executeWorkflowTrigger, redis, httpRequest, n8n-nodes-evolution-api. Event-driven trigger; 89 nodes.

Execute Workflow Trigger, Redis, HTTP Request +3
Data & Sheets

Agendamiento_v2. Uses n8n-nodes-evolution-api, redis, httpRequest, executeWorkflowTrigger. Event-driven trigger; 59 nodes.

N8N Nodes Evolution Api, Redis, HTTP Request +3
Data & Sheets

Cancelacion_v2. Uses executeWorkflowTrigger, redis, httpRequest, n8n-nodes-evolution-api. Event-driven trigger; 46 nodes.

Execute Workflow Trigger, Redis, HTTP Request +3
Data & Sheets

02-crm-sync. Uses executeWorkflowTrigger, postgres, httpRequest, stopAndError. Scheduled trigger; 24 nodes.

Execute Workflow Trigger, Postgres, HTTP Request +1
Data & Sheets

Save_Extraction. Uses executeWorkflowTrigger, postgres, httpRequest. Event-driven trigger; 22 nodes.

Execute Workflow Trigger, Postgres, HTTP Request