On this page
Sommatic Docs
Open portal

Handoff to Sommatic App

Terminal node: hands a finished workflow's result to a Sommatic AI App.

View as Markdown
Open in
Human in the loop Available sommatic.app.handoff Version 1.0.0 Execution: sync

Terminal handoff: creates a task for a user that carries an app-open descriptor (app slug, route, input, launch mode) and returns the descriptor so the run result can open the app.

How it works

  1. Resolves the config and merges it over the incoming payload (config wins); {{ }} in input_mapping are resolved on the server.
  2. Builds the descriptor: app_slug from target.app_slug, route_path from target.route (default /), launch_mode from target.launch_mode (default command-center) and input_payload from input_mapping (default {}).
  3. Checks app_slug, organization_id, assignee and task_title.
  4. Posts a task with a user assignee, status queued, source workflow and metadata.app_handoff_descriptor; the backend claims it for that user. task_type defaults to review and task_priority to medium.
  5. Returns { app_handoff_descriptor, task_id, task_title } at the top level through out, where the run result can pick up the descriptor; opening the task later relaunches the app pre-filled.

In a workflow

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

{
  "node_id": "node-handoff-approval",
  "label": "Hand off to approval desk",
  "operator_slug": "sommatic.app.handoff",
  "operator_version": "1.0.0",
  "config": {
    "target": {
      "app_slug": "sommatic-approval-desk",
      "route": "/",
      "launch_mode": "command-center"
    },
    "input_mapping": {
      "order_id": "{{ $json.order_id }}",
      "amount": "{{ $json.amount }}"
    },
    "organization_id": "<organization_id>",
    "assignee": "[email protected]",
    "task_title": "Approve order {{ $json.order_id }}"
  }
}

Configuration

target object Required
app_slug string Required

Slug of the Sommatic AI App to hand off to (e.g. my-review-app).

route string Optional

Route opened inside the app (e.g. /new-sentence). Defaults to /.

Default: /

launch_mode string Optional

How the app is opened when a live session exists.

Default: command-center

input_mapping object Optional

Payload pre-filled into the app, resolved server-side from {{...}} expressions.

organization_id string Required

Organization that owns the created Task.

assignee string Required

Identity (email) the Task is assigned to.

task_title string Required

Title of the durable HITL Task created for the handoff.

task_type object Optional

Task type descriptor. Defaults to review.

task_priority object Optional

Task priority descriptor. Defaults to medium.

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.

task_type
The default object is { id: 1, name: "review", title: "Review" }, while the backend catalog lists review with id 12. Set task_type explicitly if your inbox filters by id.
target
Undeclared top-level fallbacks are also read: app_slug, route, launch_mode, input_payload, title, type and priority.

Output ports

out default

The task was created. The run is meant to end here; it does not suspend.

Data
{
  "port": "out",
  "app_handoff_descriptor": {
    "app_slug": "sommatic-approval-desk",
    "route_path": "/",
    "input_payload": {
      "order_id": "ord_123",
      "amount": 1250
    },
    "launch_mode": "command-center"
  },
  "task_id": "task-xxxxxxxxxxxxxxx",
  "task_title": "Approve order ord_123"
}
error

A required field is missing or the backend call failed.

Data
{
  "port": "error",
  "error": "Missing 'assignee'"
}

In expressions

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

ExpressionEditorWorker
$("Handoff to Sommatic App").item.json.app_handoff_descriptorobject= {…}
$("Handoff to Sommatic App").item.json.task_idstring= "task-xxxxxxxxxxxxxxx"
$("Handoff to Sommatic App").item.json.task_titlestring= "Approve order ord_123"
$("Handoff to Sommatic App").item.json.portstringNot suggested by the editor= "out"—
$("Handoff to Sommatic App").item.json.app_handoff_descriptor.app_slugstringNot suggested by the editor= "sommatic-approval-desk"—
$("Handoff to Sommatic App").item.json.app_handoff_descriptor.route_pathstringNot suggested by the editor= "/"—
$("Handoff to Sommatic App").item.json.app_handoff_descriptor.input_payloadobjectNot suggested by the editor= {…}—
$("Handoff to Sommatic App").item.json.app_handoff_descriptor.launch_modestringNot suggested by the editor= "command-center"—

— 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 'target.app_slug' error No target.app_slug (nor a top-level app_slug).
Missing 'organization_id' error Not in the config nor in the payload.
Missing 'assignee' error The handoff always needs a user identity (email).
Missing 'task_title' error task_title (or title) is empty.
Backend did not return a task id error The backend answered without result.id.
Request failed with status code <status> error The backend rejected the task.
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

target object Optional
input_mapping object Optional
organization_id string Optional
assignee string Optional
task_title string Optional

Output contract

app_handoff_descriptor object Optional
task_id string Optional
task_title 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": "sommatic.app.handoff",
  "name": "Handoff to Sommatic App",
  "category": "hitl",
  "version": "1.0.0",
  "description": "Terminal node: hands a finished workflow's result to a Sommatic AI App. Creates a durable HITL Task carrying the open descriptor and, if a live Command Center session is subscribed, opens the app instantly. Symmetric counterpart of sommatic.app.execute (app-as-gate); this is app-as-terminal — the workflow ends and does not resume.",
  "capabilities": [
    "ui",
    "human",
    "terminal"
  ],
  "config_schema": {
    "type": "object",
    "required": [
      "target",
      "organization_id",
      "assignee",
      "task_title"
    ],
    "properties": {
      "target": {
        "type": "object",
        "title": "Target App",
        "required": [
          "app_slug"
        ],
        "properties": {
          "app_slug": {
            "type": "string",
            "title": "App Slug",
            "description": "Slug of the Sommatic AI App to hand off to (e.g. my-review-app)."
          },
          "route": {
            "type": "string",
            "title": "Route Path",
            "description": "Route opened inside the app (e.g. /new-sentence). Defaults to /.",
            "default": "/"
          },
          "launch_mode": {
            "type": "string",
            "title": "Launch Mode",
            "description": "How the app is opened when a live session exists.",
            "default": "command-center"
          }
        }
      },
      "input_mapping": {
        "type": "object",
        "title": "Input Payload",
        "description": "Payload pre-filled into the app, resolved server-side from {{...}} expressions."
      },
      "organization_id": {
        "type": "string",
        "title": "Organization",
        "description": "Organization that owns the created Task."
      },
      "assignee": {
        "type": "string",
        "title": "Assignee",
        "ui_widget": "user_picker",
        "description": "Identity (email) the Task is assigned to."
      },
      "task_title": {
        "type": "string",
        "title": "Task Title",
        "description": "Title of the durable HITL Task created for the handoff."
      },
      "task_type": {
        "type": "object",
        "title": "Task Type",
        "description": "Task type descriptor. Defaults to review."
      },
      "task_priority": {
        "type": "object",
        "title": "Task Priority",
        "description": "Task priority descriptor. Defaults to medium."
      },
      "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": {
      "target": {
        "type": "object"
      },
      "input_mapping": {
        "type": "object"
      },
      "organization_id": {
        "type": "string"
      },
      "assignee": {
        "type": "string"
      },
      "task_title": {
        "type": "string"
      }
    }
  },
  "output_contract_schema": {
    "type": "object",
    "properties": {
      "app_handoff_descriptor": {
        "type": "object"
      },
      "task_id": {
        "type": "string"
      },
      "task_title": {
        "type": "string"
      }
    }
  },
  "ports": [
    {
      "port_id": "out",
      "label": "Out",
      "is_default": true,
      "description": "Handoff delivered (Task created; app opened if live session)."
    },
    {
      "port_id": "error",
      "label": "Error"
    }
  ],
  "execution_mode": "sync",
  "tags": [
    "ui",
    "terminal",
    "handoff"
  ],
  "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
uihumanterminal
Tags
uiterminalhandoff

Notes and limits

  • It does not suspend or wait: whatever is connected to out runs right away. Use it as the last node of the run.
  • The task context.workflow_instance_id and context.trace_id are sent empty: the worker reads them from fields the runtime does not set, so the task is not linked to the run.
  • Not idempotent: every execution creates a new task. There are no retries on the HTTP call.
  • 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