Skip to main content

WorkflowsResource

Bases: object Read access to Modus workflows. client.workflows.list() → Page[Agent] client.workflows.get(workflow_id) → Agent To create, update, or deploy workflows use modus.management.ModusManagement.

list()

List workflows in the organisation.
  • Parameters:
    • page_size – Items per page (default 25).
    • page_token – Opaque token from a previous page’s next_page_token.
    • search – Case-insensitive substring filter on the workflow name.
    • type – Filter by workflow type: "task" or "workflow".
    • view – Variation view — "active" (deployed) or "draft".
    • include_variation – Include variation payload on each list row.

get()

Retrieve a workflow by ID or slug.
  • Parameters: view – Variation view — "active" (deployed) or "draft".
  • Raises: NotFoundError – if no workflow with this ID/slug exists.

chat_stream()

Send a message to a workflow and stream the reply token by token.
  • Parameters:
    • workflow_id – Workflow ID or slug.
    • message – The message to send.
    • model – Model to run this message with (required). One of the supported model IDs, e.g. "claude-sonnet-5" or "gpt-5.5".
    • thread_id – Continue an existing conversation; omit to start a new one.
    • version – Run a specific variation — "published" or "draft".
  • Returns: ChatStream you can iterate for text chunks; the final result carries the thread_id.

AsyncWorkflowsResource

Bases: object Async read access to Modus workflows. await client.workflows.list() → AsyncPage[Agent] await client.workflows.get(workflow_id) → Agent To create, update, or deploy workflows use modus.management.ModusManagement.

list()

List workflows in the organisation.
  • Parameters:
    • page_size – Items per page (default 25).
    • page_token – Opaque token from a previous page’s next_page_token.
    • search – Case-insensitive substring filter on the workflow name.
    • type – Filter by workflow type: "task" or "workflow".
    • view – Variation view — "active" (deployed) or "draft".
    • include_variation – Include variation payload on each list row.

get()

Retrieve a workflow by ID or slug.
  • Parameters: view – Variation view — "active" (deployed) or "draft".
  • Raises: NotFoundError – if no workflow with this ID/slug exists.

chat_stream()

Send a message to a workflow and stream the reply token by token.
  • Parameters:
    • workflow_id – Workflow ID or slug.
    • message – The message to send.
    • model – Model to run this message with (required). One of the supported model IDs, e.g. "claude-sonnet-5" or "gpt-5.5".
    • thread_id – Continue an existing conversation; omit to start a new one.
    • version – Run a specific variation — "published" or "draft".
  • Returns: AsyncChatStream you can iterate for text chunks; the final result carries the thread_id.

WorkflowRunsResource

Bases: object

list()

List runs for a workflow.
  • Parameters:
    • workflow_id – Workflow ID or slug.
    • page_size – Maximum number of items to return (default 25, max 100).
    • page_token – Token from a previous page’s next_page_token; omit for the first page.
    • status – Filter by run status (e.g. "running", "awaiting_human", "completed", "error", "cancelled", "all_executions").
    • timeframe – Filter by time window (e.g. "last_hour", "last_day", "last_week").
    • approval_scope – When status="awaiting_human", scope to "mine" or "all".
    • search – Free-text search filter.

active()

List active conversation runs for the current user.
  • Parameters:
    • page_size – Maximum number of active runs to return (default 50, max 100).
    • page_token – Token from a previous page’s next_page_token; omit for the first page.

active_by_session()

Return active runs for the supplied conversation thread ids.
  • Parameters: session_ids – Conversation thread ids to check; blanks and duplicates are ignored.

get()

Retrieve a Modus workflow run by ID.
  • Parameters:
    • workflow_id – Modus workflow ID or slug.
    • run_id – Run ID.
    • temporal_run_id – Optional Temporal run ID when disambiguating.

create()

Start a workflow run and stream its events.
  • Parameters:
    • workflow_id – Workflow ID or slug.
    • body – Run request fields such as message, sessionId, config, and runId.

create_scope()

Start a scope run and stream its events.
  • Parameters:
    • scope_id – Scope ID or slug.
    • body – Run request fields such as message, sessionId, config, and runId.

create_modus()

Start a Modus run and stream its events.
  • Parameters: body – Run request fields such as message, sessionId, config, and runId.

resume()

Resume a paused run and stream its events.
  • Parameters:
    • run_id – Run ID to resume.
    • body – Resume request fields including the decision and message.

cancel()

Cancel a run.
  • Parameters:
    • run_id – Run ID to cancel.
    • body – Optional cancellation details.

interrupt()

Interrupt a run.
  • Parameters:
    • run_id – Run ID to interrupt.
    • body – Optional interruption details.

edit_queued()

Edit a queued run.
  • Parameters:
    • run_id – Run ID to edit.
    • body – Optional queued-run edit details.

events()

Stream run lifecycle events.
  • Parameters: run_id – Run ID to follow.

stream()

Stream run output events.
  • Parameters: run_id – Run ID to follow.

AsyncWorkflowRunsResource

Bases: object

list()

List runs for a workflow.
  • Parameters:
    • workflow_id – Workflow ID or slug.
    • page_size – Maximum number of items to return (default 25, max 100).
    • page_token – Token from a previous page’s next_page_token; omit for the first page.
    • status – Filter by run status (e.g. "running", "awaiting_human", "completed", "error", "cancelled", "all_executions").
    • timeframe – Filter by time window (e.g. "last_hour", "last_day", "last_week").
    • approval_scope – When status="awaiting_human", scope to "mine" or "all".
    • search – Free-text search filter.

active()

List active conversation runs for the current user.
  • Parameters:
    • page_size – Maximum number of active runs to return (default 50, max 100).
    • page_token – Token from a previous page’s next_page_token; omit for the first page.

active_by_session()

Return active runs for the supplied conversation thread ids.
  • Parameters: session_ids – Conversation thread ids to check; blanks and duplicates are ignored.

get()

Retrieve a Modus workflow run by ID.
  • Parameters:
    • workflow_id – Modus workflow ID or slug.
    • run_id – Run ID.
    • temporal_run_id – Optional Temporal run ID when disambiguating.

create()

Start a workflow run and stream its events.
  • Parameters:
    • workflow_id – Workflow ID or slug.
    • body – Run request fields such as message, sessionId, config, and runId.

create_scope()

Start a scope run and stream its events.
  • Parameters:
    • scope_id – Scope ID or slug.
    • body – Run request fields such as message, sessionId, config, and runId.

create_modus()

Start a Modus run and stream its events.
  • Parameters: body – Run request fields such as message, sessionId, config, and runId.

resume()

Resume a paused run and stream its events.
  • Parameters:
    • run_id – Run ID to resume.
    • body – Resume request fields including the decision and message.

cancel()

Cancel a run.
  • Parameters:
    • run_id – Run ID to cancel.
    • body – Optional cancellation details.

interrupt()

Interrupt a run.
  • Parameters:
    • run_id – Run ID to interrupt.
    • body – Optional interruption details.

edit_queued()

Edit a queued run.
  • Parameters:
    • run_id – Run ID to edit.
    • body – Optional queued-run edit details.

events()

Stream run lifecycle events.
  • Parameters: run_id – Run ID to follow.

stream()

Stream run output events.
  • Parameters: run_id – Run ID to follow.