Documentation Index
Fetch the complete documentation index at: https://docs.ntropii.com/llms.txt
Use this file to discover all available pages before exploring further.
ntro.workflow is the orchestration surface every runbook subclasses. For the concept-level walkthrough of authoring a runbook, see Build runbooks. This page is the API reference.
Install
[workflow] extra brings in Temporal, all ntro.capabilities.* modules, ntro.events, ntro.accounting, and ntro.data — everything a runbook needs at runtime.
Surface
| Symbol | Kind | Purpose |
|---|---|---|
NtroWorkflow | class | Base class for all runbooks. Subclass + decorate with @workflow.defn. |
ui_step | decorator | Mark a method as a step; threads UI metadata (name, title, icon) into the breadcrumb. |
await_signal_with_action | method on NtroWorkflow | Block until a predicate is satisfied; advertise the pending action via current_pending_action. |
wait_for_action | method on NtroWorkflow | Block on a HITL approve / reject / correct signal from the Tenant UI. |
run_child_workflow | method on NtroWorkflow | Dispatch another runbook by slug. Children appear as nested progress trees in the UI. |
previous | function | Load committed-document context from a prior task. See ntro.workflow.task. |
NtroWorkflow
| Name | Kind | Returns / accepts | Purpose |
|---|---|---|---|
current_pending_action | query | {action, display_hint} | What is the workflow waiting for? Polled by Tenant UI. |
current_steps | query | list[{id, title, status, icon}] | The @ui_step ladder + per-step status. |
current_ui_state | query | combined snapshot | One-shot read for UI rendering. |
user_action | signal | {action, payload} | UI dispatches approve / reject / correct here. |
tb_submitted, document_submitted, …) as needed.
@ui_step
| Arg | Type | Purpose |
|---|---|---|
name | str | Stable step id (used in current_steps, snapshots, child-workflow ids). |
title | str | Display name in the Tenant UI breadcrumb. |
icon | str | Lucide icon name. |
_current_step_id, _steps_completed) tracks automatically. Class-definition order is breadcrumb order in the UI sidebar.
wait_for_action
Block on a HITL signal. The display_hint tells the Tenant UI which review component to render.
| Arg | Type | Purpose |
|---|---|---|
payload | Any (pydantic-serialisable) | What the user is reviewing — rendered by the UI component. |
display_hint | dict | UI component selector + config. |
reason | str | One-line description shown in the pending-action chip. |
UserAction(action, payload, corrections). corrections is workflow-specific (e.g. row-level edits to an extracted document).
await_signal_with_action
Block until a predicate is true. Advertises the pending action via current_pending_action so the UI knows what to surface.
@workflow.signal handler that mutates the predicate’s state.
run_child_workflow
Dispatch another runbook. Children get their own progress tree under the parent’s step.
| Arg | Type | Purpose |
|---|---|---|
slug | str | The child runbook’s slug (registered with the worker). |
input | pydantic model | Child workflow input. Must match the child’s declared Context model. |
step_id | str | Parent step id this child belongs to — drives UI nesting. |
many (fan-out): call run_child_workflow in a loop; awaits join.
Related
Build runbooks (concept)
Worked walkthrough of authoring a runbook from scratch.
ntro.workflow.task
Load context from prior task executions.
ntro.workflow.agents
Invoke a registered external agent from inside a
@ui_step.UI and Temporal signals
How Tenant UI actions reach workflows end-to-end.