Skip to content

Stop an execution

Graceful stop of a run in progress: the current node finishes, nothing else runs and the partial usage arrives in the done.

Updated on Aug 10, 2026

Multi-agent workflows can run for minutes. If you already have what you need — or the user gave up — stop the run with the thread_id that arrived in the first event.

POSThttps://agents.hinow.ai/v1/agents/runs/{thread_id}/stopBearer hi_YOUR_API_KEY

Gracefully stops the active execution of this thread.

Parâmetros

  • thread_idstring· pathobrigatório

    The thread_id returned in the first event of the run.

Respostas

200Request accepted. `stopped: false` means the run had already finished on its own.
{"success": true, "thread_id": "ae732033-...", "stopped": true}
404No active run with that thread_id in your scope.

What happens

  1. 1

    The request is accepted immediately

    The response arrives in ~50 ms. The signal goes to the workflow runtime.

  2. 2

    The step in progress completes

    The model call or tool in flight completes (it was already started — and charged). No new step begins: neither the next node, nor the next round of a debate, nor the next voter.

  3. 3

    The run shuts down cleanly

    The stream receives workflow_stopped and then done with the partial usage. The conversation and persisted variables are saved — the thread can continue later.

final do stream após um stopjson
data: {"type":"workflow_node_end","data":{"node_id":"juiz-intro","success":true}}

data: {"type":"workflow_stopped","data":{"node_id":"debate-loop","reason":"user_requested"}}

data: {"type":"done","usage":{"cost":0.00066,"input_tokens":829,"output_tokens":406,"time":54.7}}

In synchronous mode (stream: false), the response arrives with finish_reason: "stopped" and the partial text of what was produced up to that point.

Stop ≠ disconnect

Closing the SSE connection also aborts the run — but then you lose the done and the usage. Stop exists for synchronous mode and to stop while keeping the connection open until clean shutdown.

The time until effective shutdown depends on the step in flight: with a slow model provider, it can take up to ~1 minute. What never happens is a new step starting after the stop.

Was this page helpful?