AutomationFlowsData & Sheets › Orquestrador

Orquestrador

Orquestrador. Uses scheduleTrigger, postgres, errorTrigger, executeWorkflow. Scheduled trigger; 7 nodes.

Cron / scheduled trigger★★★★☆ complexity7 nodesPostgresError Trigger
Data & Sheets Trigger: Cron / scheduled Nodes: 7 Complexity: ★★★★☆

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
{
  "name": "Orquestrador",
  "nodes": [
    {
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "minutes"
            }
          ]
        }
      },
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1.3,
      "position": [
        -112,
        208
      ],
      "id": "248bf64a-1acf-4f0a-8452-8c9ad413562e",
      "name": "Schedule Trigger"
    },
    {
      "parameters": {
        "operation": "upsert",
        "schema": {
          "__rl": true,
          "value": "public",
          "mode": "list",
          "cachedResultName": "public"
        },
        "table": {
          "__rl": true,
          "value": "dw_pipeline_state",
          "mode": "list",
          "cachedResultName": "dw_pipeline_state"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "workflow_name": "Orquestrador",
            "last_success_run": "={{ new Date().toISOString() }}",
            "updated_at": "={{ new Date().toISOString() }}"
          },
          "matchingColumns": [
            "workflow_name"
          ],
          "schema": [
            {
              "id": "workflow_name",
              "displayName": "workflow_name",
              "required": true,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "last_processed_id",
              "displayName": "last_processed_id",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": false,
              "removed": true
            },
            {
              "id": "last_page_processed",
              "displayName": "last_page_processed",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "number",
              "canBeUsedToMatch": false,
              "removed": true
            },
            {
              "id": "last_success_run",
              "displayName": "last_success_run",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "dateTime",
              "canBeUsedToMatch": false
            },
            {
              "id": "updated_at",
              "displayName": "updated_at",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "dateTime",
              "canBeUsedToMatch": false,
              "removed": false
            }
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {}
      },
      "type": "n8n-nodes-base.postgres",
      "typeVersion": 2.6,
      "position": [
        560,
        208
      ],
      "id": "0559dd7e-88f1-43e7-9237-76d19083a00a",
      "name": "Atualiza Controle",
      "credentials": {
        "postgres": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {},
      "type": "n8n-nodes-base.errorTrigger",
      "typeVersion": 1,
      "position": [
        -112,
        432
      ],
      "id": "75c4b67b-0bf7-4685-a552-b6ba79b50bac",
      "name": "Error Trigger"
    },
    {
      "parameters": {
        "jsCode": "const timestamp = new Date().toISOString();\n\nconst logMessage = {\n  level: \"INFO\",\n  event: \"PIPELINE_MASTER_FINISHED\",\n  timestamp: timestamp,\n  status: \"SUCCESS\",\n  message: \"O pipeline executou a Ingest\u00e3o e o Processamento com sucesso.\"\n};\n\nconsole.log(JSON.stringify(logMessage));\n\nreturn (logMessage);"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        784,
        208
      ],
      "id": "591db68e-3dba-4173-b4a3-90d677ce7d1e",
      "name": "Log Sucesso",
      "alwaysOutputData": false
    },
    {
      "parameters": {
        "jsCode": "// Recupera o JSON completo que saiu do Error Trigger\nconst triggerData = $input.first().json;\n\nconst timestamp = new Date().toISOString();\n\nconst logMessage = {\n  level: \"ERROR\",\n  event: \"PIPELINE_MASTER_FAILED\",\n  timestamp: timestamp,\n  status: \"FAILED\",\n  error_message: triggerData.execution.error.message, \n  error_stack: triggerData.execution.error.stack,\n  failed_node: triggerData.execution.lastNodeExecuted,\n  workflow: triggerData.workflow.name\n};\n\nconsole.log(JSON.stringify(logMessage));\nreturn logMessage;\n"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        112,
        432
      ],
      "id": "2d04ce84-ba40-44d7-8f03-db5775cf2795",
      "name": "Log Error"
    },
    {
      "parameters": {
        "workflowId": {
          "__rl": true,
          "value": "UomdlRvaOuMDP9kGl1BLD",
          "mode": "list",
          "cachedResultUrl": "/workflow/UomdlRvaOuMDP9kGl1BLD",
          "cachedResultName": "ProcessamentoBronze"
        },
        "workflowInputs": {
          "mappingMode": "defineBelow",
          "value": {},
          "matchingColumns": [],
          "schema": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": true
        },
        "options": {
          "waitForSubWorkflow": true
        }
      },
      "type": "n8n-nodes-base.executeWorkflow",
      "typeVersion": 1.3,
      "position": [
        112,
        208
      ],
      "id": "24e392d1-6371-4d1e-809d-00ba27119bc3",
      "name": "Call 'ProcessamentoBronze'",
      "alwaysOutputData": true
    },
    {
      "parameters": {
        "workflowId": {
          "__rl": true,
          "value": "zqc5LJbJ6rodczG0zw-UT",
          "mode": "list",
          "cachedResultUrl": "/workflow/zqc5LJbJ6rodczG0zw-UT",
          "cachedResultName": "ProcessamentoGold"
        },
        "workflowInputs": {
          "mappingMode": "defineBelow",
          "value": {},
          "matchingColumns": [],
          "schema": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": true
        },
        "options": {
          "waitForSubWorkflow": true
        }
      },
      "type": "n8n-nodes-base.executeWorkflow",
      "typeVersion": 1.3,
      "position": [
        336,
        208
      ],
      "id": "34f0c353-d6c0-4868-aa5f-7253f6de989f",
      "name": "Call 'ProcessamentoGold'",
      "alwaysOutputData": true
    }
  ],
  "connections": {
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "Call 'ProcessamentoBronze'",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Atualiza Controle": {
      "main": [
        [
          {
            "node": "Log Sucesso",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Error Trigger": {
      "main": [
        [
          {
            "node": "Log Error",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Call 'ProcessamentoBronze'": {
      "main": [
        [
          {
            "node": "Call 'ProcessamentoGold'",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Call 'ProcessamentoGold'": {
      "main": [
        [
          {
            "node": "Atualiza Controle",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": true,
  "settings": {
    "executionOrder": "v1",
    "availableInMCP": false
  },
  "versionId": "4b852b40-3bb5-4f00-a2bc-3e0f94ee67f4",
  "id": "xdBMUnZwtZxdoMKt248E-",
  "tags": []
}

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.

About this workflow

Orquestrador. Uses scheduleTrigger, postgres, errorTrigger, executeWorkflow. Scheduled trigger; 7 nodes.

Source: https://github.com/GuiMarcos/fullstack-data-pipeline/blob/5ac9779e55dc78b1f789040d0c769fdd29568fa0/workflows/Orquestrador.json — original creator credit. Request a take-down →

More Data & Sheets workflows → · Browse all categories →