Skip to content

Error Handling

Production workflows need a layered approach to error handling. A single uncaught failure can cause silent data loss. Use all three layers described here for workflows that handle business-critical data.

Layer 1 — Node-Level Error Routing

Set onError to continueErrorOutput on critical nodes. This routes errors to the node's second output instead of stopping the workflow.

When to use: On any node where a failure should be handled gracefully rather than crashing the whole workflow — for example, getSingleObject (record may not exist), external HTTP calls (the service may be unavailable), and the first processing node after a webhook trigger.

Configuration: In the node settings panel, set On errorContinue (using error output).

The error output provides:

{
  "error": {
    "message": "404 - Object not found",
    "name": "NodeApiError",
    "httpCode": "404"
  },
  "json": { /* original input to the failed node */ }
}

Use an IF node on the error branch to distinguish recoverable errors from non-recoverable ones — for example, a 404 may mean "record not found, create it" or "no match, skip" depending on your workflow's intent; a 401 always means alert immediately.


Layer 2 — Error Handler Sub-Workflow

Create a reusable error logging sub-workflow and call it from the error branches of your main workflows.

Sub-workflow setup:

  1. Create a new workflow named Util: Log Integration Error.
  2. Add an Execute Workflow Trigger as the first node.
  3. Add a Lime CRM createSingleObject node pointing to your monitoring Limetype (for example integration_monitor_log):
    {
      "workflow_name": "{{ $json.workflowName }}",
      "error_message": "{{ $json.errorMessage }}",
      "record_id": "{{ $json.recordId }}",
      "timestamp": "{{ $now.toISO() }}"
    }
    

Calling the sub-workflow from a main workflow's error branch:

Add an Execute Workflow node on every error branch: - Workflow: Util: Log Integration Error - Input data:

{
  "workflowName": "Sync Deal to ERP on Update",
  "errorMessage": "{{ $json.error.message }}",
  "recordId": "{{ $('Get deal').item.json._id }}"
}


Layer 3 — Global Workflow Error Trigger

Configure a global error handler that catches any unhandled exception in any workflow.

Setup:

  1. Create a new workflow named Util: Handle Global Errors.
  2. Add an Error Trigger node as the first node (under Trigger → On Error).
  3. Add alerting: write to a monitoring Limetype, send a Slack message, or post to a webhook.

The Error Trigger payload includes:

{
  "workflow": { "id": "...", "name": "Sync Deal to ERP on Update" },
  "execution": { "id": "...", "url": "https://..." },
  "error": { "message": "...", "name": "..." },
  "lastNodeExecuted": "Sync to ERP"
}

Activate the global handler in each workflow:

In Workflow settingsError workflow: select Util: Handle Global Errors.


Common Error Scenarios

HTTP status Meaning Recommended handling
404 Record not found Create the record (upsert pattern) or log and skip
401 Invalid API key Alert immediately — credential needs to be updated
403 Insufficient permissions Alert — API key lacks required access
400 Validation error Log the invalid payload; fix the data mapping
429 Rate limit exceeded Add a Wait node (5–60 s) before retrying; alert if persistent

Alerting Options

Writing to a Lime CRM monitoring Limetype is a convenient baseline since it keeps the error visible alongside the data it concerns — but it requires someone to actively check it. For failures that need immediate attention, pair it with an active notification using whichever channel your organisation already monitors.

The workflow tool has native nodes for the most common communication tools (Slack, Microsoft Teams, email). For email specifically, Lime Marketing is a natural fit if your organisation already uses it — call the Lime Marketing API via an HTTP Request node to send a transactional notification to the right recipient. For other tools, an HTTP Request node pointed at an inbound webhook is usually sufficient.

A good pattern is to send both: a log entry for traceability, and a push notification so the right person is alerted without having to go looking.

The Util: Log Integration Error sub-workflow is the right place to centralise this — add the notification step there once and every workflow that calls it gets consistent alerting automatically.


Error Handling Checklist

Before activating a workflow in production, verify:

  • Every node that can fail (Lime CRM operations, external API calls) has an error output configured
  • The error output routes to a logging or alerting step, not a dead end
  • The error log includes: workflow name, record ID, error message, and timestamp
  • A global Error Trigger workflow is configured in workflow settings
  • 404 errors are handled as a business case, not treated as a crash
  • Rate limit errors (429) trigger a wait and retry, not a silent failure
  • Auth failures (401/403) trigger an immediate alert

Example: Combining All Three Layers

Lime CRM Trigger
  └─► getSingleObject (related record)   (onError: continueErrorOutput)
        ├─► [success] ──► HTTP Request (external API)   (onError: continueErrorOutput)
        │                   ├─► [success] ──► updateSingleObject ──► Done
        │                   └─► [error]  ──► Execute Workflow: Util: Log Integration Error
        └─► [error]  ──► Execute Workflow: Util: Log Integration Error

Global Error Trigger workflow: catches anything that slips through.

Note

The global error trigger only activates if each workflow has it configured. Go to Workflow settings → Error workflow and select Util: Handle Global Errors in every production workflow.