On this page
Sommatic Docs
Open portal

Approval Gate

Configures the approval gate on a task created by a preceding Create Task node.

View as Markdown
Open in
Human in the loop Partial human.approval.gate Version 1.0.0 Execution: sync

Partial. Attaches an approval configuration to an existing task so the Tasks inbox opens it with the human approval gate app, then continues at once through accepted; it does not wait for the decision.

How it works

  1. Resolves the config and merges it over the incoming payload (config wins).
  2. Reads task_id from the config or the incoming payload, normally the output of the preceding human.task.create.
  3. Checks task_id, approval_type.name and title, then builds hitl as { approval_type, title, description, ...hitl_config }.
  4. Reads the task from the Work Management API; fails if it does not exist.
  5. Writes the whole task back with payload.hitl and execution { app_slug: "human-approval-gate", launch_mode: "embedded" } merged into the existing values.
  6. Returns { task_id, approval_type, decision: null } through accepted.

In a workflow

The node as it appears in a workflow file (draft_nodes[]), and the envelope of a successful run.

{
  "node_id": "node-approve-refund",
  "label": "Approve refund",
  "operator_slug": "human.approval.gate",
  "operator_version": "1.0.0",
  "config": {
    "approval_type": {
      "id": 1,
      "name": "binary_approval",
      "title": "Binary Approval",
      "color": "#1976d2"
    },
    "title": "Approve refund for {{ $json.task_title }}",
    "description": "Confirm the refund before it is issued.",
    "hitl_config": {}
  }
}

Configuration

approval_type object Required

Binary | Tool | Plan Review | Single-Select | Multi-Select | Review/Edit/Reject

title string Required Accepts expressions

Shown to the approver when the task is claimed. Supports expressions like {{ $json.entity_name }}.

description string Optional Accepts expressions

Context shown to the approver inside the task detail. Supports expressions and multi-line text.

hitl_config object Optional

Subtype-specific fields (tool, plan, options, content, min_selection, etc.)

Its configuration shows the shared execution settings, but this node does not apply retries (retryOnFail, maxTries) yet. continueOnFail is not applied by any node.

Behaviour in the code

What the implementation does with these keys beyond what the schema says.

approval_type
One of binary_approval (1), tool_approval (2), plan_review (3), single_select_decision (4), multi_select_decision (5), review_edit_reject (6), as { id, name, title, color }.
hitl_config
Spread into hitl, so its keys can override approval_type, title and description. Shapes per type: tool_approval { tool: { name, args, risk_level } }; plan_review { plan: { steps: [{ id, title, detail }] } }; select types { options: [{ id, name, title }] }; review_edit_reject { content: { text, editable } }.

Output ports

accepted default

The gate was configured on the task. It does not mean anyone approved.

Data
{
  "port": "accepted",
  "task_id": "task-xxxxxxxxxxxxxxx",
  "approval_type": {
    "id": 1,
    "name": "binary_approval",
    "title": "Binary Approval",
    "color": "#1976d2"
  },
  "decision": null
}
rejected

Never emitted: the worker does not wait for the decision.

timeout

Never emitted.

error

Missing inputs, task not found or the backend call failed.

Data
{
  "port": "error",
  "error": "Missing 'approval_type' or invalid approval type object"
}

In expressions

What a later node can read from this node's output with $("Approval Gate").item.json.<path> (write your node's label instead of Approval Gate). Editor marks the paths the workflow editor suggests under Previous Nodes (the output contract); Worker marks the paths the worker really returns through accepted, from the output shown in Ports.

ExpressionEditorWorker
$("Approval Gate").item.json.task_idstring= "task-xxxxxxxxxxxxxxx"
$("Approval Gate").item.json.approval_typeobject= {…}
$("Approval Gate").item.json.decisionstring= nullThe actual human decision. Populated when suspend/resume is implemented; null in the current fire-and-forget mode.
$("Approval Gate").item.json.selectedarrayThe worker does not return it: reads as undefinedPopulated for single_select / multi_select approval types. —
$("Approval Gate").item.json.edited_contentobjectThe worker does not return it: reads as undefinedPopulated when the approver edited plan steps or review content before approving. —
$("Approval Gate").item.json.commentstringThe worker does not return it: reads as undefined —
$("Approval Gate").item.json.approverstringThe worker does not return it: reads as undefined —
$("Approval Gate").item.json.portstringNot suggested by the editor= "accepted"—
$("Approval Gate").item.json.approval_type.idnumberNot suggested by the editor= 1—
$("Approval Gate").item.json.approval_type.namestringNot suggested by the editor= "binary_approval"—
$("Approval Gate").item.json.approval_type.titlestringNot suggested by the editor= "Binary Approval"—
$("Approval Gate").item.json.approval_type.colorstringNot suggested by the editor= "#1976d2"—

— Editor: The editor suggests it, but the worker does not return it: it reads as undefined.

— Worker: The worker returns it but the editor does not suggest it: write it by hand. Keys inside objects can depend on your data or configuration (for example one key per label).

Errors

Message Port Cause and fix
Missing 'task_id'. This node must be chained after a Human Task Create node. If you are testing with 'Execute step', run the preceding Create Task node first or provide sample data that includes task_id. error No task_id in the config or the payload.
Missing 'approval_type' or invalid approval type object error approval_type is missing or has no name.
Missing 'title' error title is empty after resolving expressions.
Task '<task_id>' not found. Cannot configure approval gate on a non-existent task. error The task id does not exist in Work Management.
Backend rejected the update error The update answered without success; the backend message is used when present.
Request failed with status code <status> error The backend rejected the read or the update.
services.apiManager.uri is not resolved in dependencies.config — check Link Loom Cloud environment config. error The orchestrator has no backend address configured. This is a service configuration problem, not a node problem.

Input contract

task_id string Optional

Propagated from preceding Create Task node

approval_type object Optional
title string Optional
description string Optional
hitl_config object Optional

Output contract

task_id string Optional
approval_type object Optional
decision string Optional

The actual human decision. Populated when suspend/resume is implemented; null in the current fire-and-forget mode.

Allowed values: approvedrejectededitedtimeout

selected array Optional

Populated for single_select / multi_select approval types.

edited_content object Optional

Populated when the approver edited plan steps or review content before approving.

comment string Optional
approver string Optional

Contracts (JSON Schema)

The definition exactly as the orchestrator declares it. All is the whole *.definition.js; compare it with the sections above to spot differences between the documentation and the schema. Use it to validate a node before you publish.

{
  "slug": "human.approval.gate",
  "name": "Approval Gate",
  "category": "hitl",
  "version": "1.0.0",
  "description": "Configures the approval gate on a task created by a preceding Create Task node. Writes payload.hitl + execution.app_slug via PATCH to the backend.",
  "capabilities": [
    "approval",
    "gate",
    "human"
  ],
  "config_schema": {
    "type": "object",
    "required": [
      "approval_type",
      "title"
    ],
    "properties": {
      "approval_type": {
        "type": "object",
        "title": "Approval Type",
        "ui_widget": "hitl_approval_type_picker",
        "description": "Binary | Tool | Plan Review | Single-Select | Multi-Select | Review/Edit/Reject"
      },
      "title": {
        "type": "string",
        "title": "Title",
        "format": "expression",
        "description": "Shown to the approver when the task is claimed. Supports expressions like {{ $json.entity_name }}."
      },
      "description": {
        "type": "string",
        "title": "Description",
        "format": "expression",
        "description": "Context shown to the approver inside the task detail. Supports expressions and multi-line text."
      },
      "hitl_config": {
        "type": "object",
        "title": "Approval configuration",
        "ui_widget": "hitl_config",
        "ui_options": {
          "depends_on": "approval_type"
        },
        "description": "Subtype-specific fields (tool, plan, options, content, min_selection, etc.)"
      },
      "execution": {
        "type": "object",
        "title": "Execution Settings",
        "properties": {
          "alwaysOutputData": {
            "type": "boolean",
            "title": "Always Output Data",
            "description": "Always output data, even on error (if configured).",
            "default": false
          },
          "retryOnFail": {
            "type": "boolean",
            "title": "Retry On Fail",
            "description": "Retry the execution if it fails.",
            "default": false
          },
          "maxTries": {
            "type": "integer",
            "title": "Max Retries",
            "description": "Number of retries.",
            "default": 3,
            "displayOptions": {
              "show": {
                "retryOnFail": [
                  true
                ]
              }
            }
          },
          "waitBetweenTries": {
            "type": "integer",
            "title": "Wait Between Retries (ms)",
            "default": 1000,
            "displayOptions": {
              "show": {
                "retryOnFail": [
                  true
                ]
              }
            }
          },
          "continueOnFail": {
            "type": "boolean",
            "title": "Continue On Fail",
            "description": "Do not crash workflow on error.",
            "default": false
          },
          "timeout_ms": {
            "type": "integer",
            "title": "Timeout (ms)",
            "description": "Max execution time for this node before it is killed, in milliseconds. Honored by long-running operators (e.g. OCR/extraction, inline code). Default 300000 (5 min).",
            "default": 300000
          }
        }
      }
    }
  },
  "input_contract_schema": {
    "type": "object",
    "properties": {
      "task_id": {
        "type": "string",
        "description": "Propagated from preceding Create Task node"
      },
      "approval_type": {
        "type": "object"
      },
      "title": {
        "type": "string"
      },
      "description": {
        "type": "string"
      },
      "hitl_config": {
        "type": "object"
      }
    }
  },
  "output_contract_schema": {
    "type": "object",
    "properties": {
      "task_id": {
        "type": "string"
      },
      "approval_type": {
        "type": "object"
      },
      "decision": {
        "type": "string",
        "enum": [
          "approved",
          "rejected",
          "edited",
          "timeout"
        ],
        "description": "The actual human decision. Populated when suspend/resume is implemented; null in the current fire-and-forget mode."
      },
      "selected": {
        "type": "array",
        "description": "Populated for single_select / multi_select approval types."
      },
      "edited_content": {
        "type": "object",
        "description": "Populated when the approver edited plan steps or review content before approving."
      },
      "comment": {
        "type": "string"
      },
      "approver": {
        "type": "string"
      }
    }
  },
  "ports": [
    {
      "port_id": "accepted",
      "label": "Accepted",
      "is_default": true,
      "description": "Emitted when the approver confirms the action (Approve / Allow / Confirm / Submit edits)."
    },
    {
      "port_id": "rejected",
      "label": "Rejected",
      "description": "Emitted when the approver denies or cancels (Reject / Deny / Cancel)."
    },
    {
      "port_id": "timeout",
      "label": "Timeout",
      "description": "Emitted when the task expires without a decision (SLA breached)."
    },
    {
      "port_id": "error",
      "label": "Error",
      "description": "Emitted on technical failures during approval gate configuration."
    }
  ],
  "chain_constraints": {
    "prev": {
      "required_slug": "human.task.create",
      "message": "Human Approval Gate requires a preceding Create Task node to receive the task_id."
    }
  },
  "execution_mode": "sync",
  "tags": [
    "approval",
    "gate",
    "human",
    "hitl"
  ],
  "is_stateful": false,
  "publisher": {
    "identity": "org_sommatic_ai",
    "profile": {
      "name": "Sommatic AI",
      "verified": true,
      "url": "https://me.veripass.com/sommatic",
      "logo_url": null
    }
  }
}

Execution

Execution
sync
Stateful
No
Retries (retryOnFail)
No
Capabilities
approvalgatehuman
Tags
approvalgatehumanhitl

Notes and limits

  • Not implemented: suspending the run and routing the decision. decision is always null; selected, edited_content, comment and approver from the output contract are never returned; rejected and timeout never fire.
  • The update is a read-modify-write of the whole task: changes made to the task between the read and the write are overwritten. The task status is not changed.
  • The worker returns its fields at the top level of the envelope, without data, so the engine uses the whole envelope (including the port key) as the payload of the next node.
  • The worker does not set ok (the example shows true); the engine routes only by port.

Reviewed against the orchestrator code · 31e874b · 2026-11-26

Install agent tools

Give your coding agent the official Sommatic AI docs: skills, the docs MCP server and Markdown pages, so it never has to scrape the site.

Skills only. They do not update by themselves; run it again to refresh.

npx skills add https://docs.sommatic.ai
How agents read these docs