SDK methods

Helpers on StackgenClient. Pick Python, TypeScript, or Go. A row links to a code sample when a journey page shows that call. Methods without a Go name hide when Go is selected.

Runnable scripts for the common journeys are in code samples.

Client setup

Build a client from the environment, compose a workflow in code, or check whether a follow-up Ask joined the turn that is already running.

StackgenConfig.from_env

Build config from STACKGEN_URL, STACKGEN_TOKEN, and STACKGEN_WORKSPACE_ID.

StackgenClient.from_env

Build a client from those same environment variables.

create_agent

Describe an agent in code before you publish a workflow.

Create a workflow

create_stage

Describe one workflow stage and which agent runs it.

Create a workflow

create_workflow

Start a workflow composition you finish with then and commit.

Create a workflow

WorkflowBuilder.then

Append a stage to the workflow you are composing.

Create a workflow

WorkflowBuilder.commit

Freeze the builder into a workflow you can publish.

Create a workflow

WorkflowDefinition.to_payload

Return the JSON body for a committed workflow.

is_steer_response

Return true when a follow-up Ask was absorbed by the turn already running.

Ask mid-turn steer

Aiden

Call these on client.aiden. They cover Ask, webhooks, sessions, agents, integrations, schedules, policy, audit, and chat.

aiden.start_ask

Start an Ask turn on a new or existing session and return session and trace ids without waiting.

Ask → execution

aiden.wait_for_execution

Poll an execution until it settles.

Ask → execution

aiden.wait_for_subscribe_complete

Follow the execution stream until the turn completes.

Ask → session artifacts

aiden.stream_execution_events

Yield AG-UI text and tool-call events until the turn finishes.

Stream agent chat

aiden.list_agents

List agents in the workspace for a chat target picker.

Stream agent chat

aiden.list_workflows

List workflows in the workspace for a chat target picker.

Stream agent chat

aiden.run_ask_and_download_artifact

Start Ask, wait until the artifact is ready, and download it.

Ask → artifact

aiden.get_run_status

Read whether a run you started elsewhere is still going, failed, or ready, in one shot.

Async Ask worker

aiden.get_execution_trace

Read one execution trace by trace id.

aiden.list_executions

List recent executions, optionally for one session.

Automation surface

aiden.download_execution_debug_zip

Download the execution debug ZIP for a trace id.

Ask → debug ZIP

aiden.list_execution_tool_calls

List tool calls recorded on an execution trace.

aiden.list_sessions

Search sessions by text or source.

Automation surface

aiden.get_session

Read one session by id.

Automation surface

aiden.list_session_artifacts

List files attached to a session.

Async webhook CI

aiden.download_session_artifact

Download one named session file to a local path.

Async Ask worker

aiden.download_session_artifacts

Download every named file on a session into a directory.

Ask → session artifacts

aiden.export_session

Fetch the session report, notes, or evidence when you want the write-up without a file download.

Ask → export report

aiden.terminate_session

Stop work still running for a session.

Automation surface

aiden.fork_session

Branch a session so a new run starts from an existing one.

aiden.update_session

Rename, star/unstar, or archive/unarchive a session. Only the fields you pass change.

Chat session attachments

aiden.download_session_attachment

Download a chat attachment by its stable attachment_id.

Chat session attachments

aiden.delete_session_attachments

Delete every stored chat attachment for a session.

Chat session attachments

aiden.run_webhook_and_download_report

Trigger a webhook, wait for the session report, and download it.

Webhook → session → artifact

aiden.trigger_webhook

Post a payload to start a webhook workflow and return without waiting.

Async webhook worker

aiden.get_webhook_run

Read one webhook invocation by id.

Async webhook CI

aiden.list_webhook_runs

List invocations for a webhook.

aiden.wait_for_webhook_session

Poll a webhook invocation until it has a session id.

Async webhook worker

aiden.create_webhook

Create a webhook, including an acknowledgement status and headers when the provider needs an immediate response, or a filter_cel condition to skip unrelated deliveries.

Webhook acknowledgement

aiden.get_webhook

Read one webhook by id.

aiden.update_webhook

Update a webhook, including acknowledgement status, headers, and the filter_cel condition (send an empty string to clear it).

Webhook condition (filter_cel)

aiden.preview_webhook_filter

Try a draft filter_cel condition against a sample event and headers. Saves nothing and starts no work.

Webhook condition (filter_cel)

aiden.delete_webhook

Delete a webhook.

aiden.create_schedule

Create a schedule that starts work on a timer.

Webhook + schedule + HITL

aiden.list_schedule_runs

List runs for a schedule.

aiden.delete_schedule

Delete a schedule.

aiden.publish_workflow

Register the agents and publish a workflow you composed with create_workflow.

Create a workflow

aiden.start_workflow_run

Start a named workflow and return session and trace ids without waiting.

aiden.run_workflow

Start a named workflow and pass an optional input body.

aiden.delete_workflow

Delete a workflow.

aiden.get_agent

Read one agent by name.

aiden.deregister_agent

Remove an agent registration.

aiden.get_agent_health

Read the latest health check for an agent.

aiden.start_agent_chat

Start a chat with one agent.

aiden.start_agent_chat_with_files

Start a chat turn with one or more file attachments (multipart/form-data).

Chat session attachments

aiden.list_integrations

List integrations in the workspace.

aiden.list_integration_types

List the integration types you can connect.

aiden.upsert_integration_with_secrets

Store Vault credentials and upsert the integration those credentials belong to.

Integration secrets → agent → Ask

aiden.delete_integration

Delete an integration.

aiden.test_integration_connection

Check whether an integration can reach its upstream service.

aiden.refresh_integration_tools

Refresh the tool list discovered for an integration.

aiden.list_approvals

List human approvals waiting on an agent.

aiden.get_approval

Read one approval by id.

aiden.resolve_approval

Approve or reject a waiting human-in-the-loop request.

Webhook + schedule + HITL

aiden.attach_policy

Attach a policy to an agent. Shadow mode logs the decision and does not block.

Policy guardrails and break-glass

aiden.evaluate_policy

Evaluate a policy against a sample input without running a turn.

aiden.when_policies_disagree

Choose what happens when several policies on one agent disagree.

Policy guardrails and break-glass

aiden.break_glass

Open a time-limited outage bypass so the agent runs without policy enforcement.

Policy guardrails and break-glass

aiden.get_break_glass

Read whether break-glass is active, who opened it, and when it expires.

aiden.list_audit_events

Read the first page of audit events.

Export audit events

aiden.iter_audit_events

Walk every matching audit event past the first page.

Export audit events

aiden.export_audit_events

Write matching audit events to an NDJSON file, in the native shape or OCSF.

Export audit events

aiden.get_audit_event

Read one audit event by id, including the full payload.

Export audit events

aiden.list_audit_facets

List facet values you can use to filter audit events.

aiden.list_chat_subscriptions

List Slack or Teams subscriptions that point at your app.

aiden.create_chat_subscription

Point a chat channel at your app so messages start work.

Chat subscriptions

aiden.get_chat_subscription

Read one chat subscription by id.

aiden.update_chat_subscription

Update a chat subscription.

aiden.toggle_chat_subscription

Mute or resume a chat subscription without deleting it.

Chat subscriptions

aiden.delete_chat_subscription

Delete a chat subscription.

Chat subscriptions

aiden.create_knowledge_hub

Create a knowledge hub agents can read.

aiden.delete_knowledge_hub

Delete a knowledge hub.

aiden.create_knowledge_document

Add a document to a knowledge hub.

aiden.get_knowledge_document

Read one knowledge document by id.

aiden.list_knowledge_documents

List knowledge documents.

aiden.delete_knowledge_document

Delete a knowledge document.

aiden.list_knowledge_items

List indexed items inside a knowledge hub.

aiden.create_skill

Create a skill you can attach to a workflow stage.

aiden.delete_skill

Delete a skill.

aiden.list_models

List models available to agents in the workspace.

aiden.llm.test_model

Probe a model configuration without registering it; returns success/message.

Test and retire a model

aiden.llm.delete_model

Delete a registered model.

Test and retire a model

aiden.llm.delete_provider

Delete an LLM provider. Delete its models first.

Test and retire a model

aiden.list_tools

List tools agents can call.

aiden.create_remote_runner

Register a remote runner that executes tools outside the platform.

aiden.get_remote_runner

Read one remote runner by id.

aiden.list_remote_runners

List remote runners.

aiden.list_remote_runner_tasks

List tasks queued on a remote runner.

aiden.revoke_remote_runner

Revoke a remote runner so it can no longer execute tools.

SRE

Call these on client.sre. Pull alerts, start an investigation, wait for the RCA, and triage the inbox.

sre.list_alerts

List alerts, with optional status and text filters.

SRE investigate alert

sre.get_alert

Read one alert by id.

sre.pull_alerts

Start an async alert pull (joins an in-progress pull on 409).

SRE pull alerts

sre.pull_alerts_and_wait

Start a pull and wait until it finishes.

SRE pull alerts

sre.wait_for_alert_pull

Poll one pull until completed or failed.

sre.get_alert_pull

Read one alert pull by id.

sre.list_alert_pulls

List recent alert pulls.

sre.ignore_alert

Mark an alert ignored.

SRE triage alerts

sre.unignore_alert

Return an ignored alert to active.

sre.set_alert_attention

Override attention (needs_attention, needs_review, false_positive, others).

SRE triage alerts

sre.update_alert

Raw alert patch (do not send status and attention together).

sre.investigate_alert

Start an investigation from an alert.

SRE investigate alert

sre.investigate_alert_and_wait

Start an investigation and wait for the RCA.

SRE investigate alert

sre.wait_for_investigation

Poll while queued or running; return on completed, draft, or resolved.

sre.list_investigations

List investigations.

sre.get_investigation

Read an investigation, including status and the write-up when it is ready.

SRE investigate alert

sre.list_investigation_groups

List investigations grouped by alert.

SRE triage alerts

sre.resolve_investigations

Mark investigation threads resolved.

SRE triage alerts

sre.cancel_investigations

Cancel investigation threads.

sre.fork_investigation

Fork an investigation into a new thread that keeps the parent RCA.

sre.list_remediation_checks

List post-remediation verification rows for an investigation.

DevOps

Call these on client.devops. Sync the Ops Inbox, wait for triage, approve a request, and discover workflows from recent tickets.

devops.setup_status

Read which ticket trackers are connected.

devops.sync_requests

Pull tickets into the Ops Inbox.

DevOps sync inbox

devops.list_requests

List inbox requests with status and matched workflow.

DevOps sync inbox

devops.get_request

Read one request by id.

devops.fetch_request

Import one ticket key such as CORE-981.

devops.fetch_and_wait

Fetch one ticket and wait until triage settles.

DevOps approve request

devops.wait_for_triage

Poll while status is new or triaging.

devops.approve_and_wait

Approve a request and wait for the run.

DevOps approve request

devops.approve_request

Approve a request without waiting.

devops.wait_for_execution

Poll until execution_status is completed or failed.

devops.post_source_comment

Post a comment on the upstream ticket.

devops.defer_request

Defer a request for later review.

devops.reopen_request

Move a resolved request back to awaiting_approval.

devops.retriage_request

Queue a fresh AI classification.

devops.stop_triage

Stop active triage.

devops.list_workflows

List workflows eligible for request execution.

devops.inbox_funnel

Read Ops Inbox funnel metrics for a period.

devops.start_workflow_discovery

Start workflow discovery from recent tickets.

DevOps discover workflows

devops.wait_for_workflow_discovery

Poll discovery until ready or failed.

DevOps discover workflows

devops.latest_workflow_discovery

Read the latest discovery run.

Vault

Call these on client.vault when you store and rotate secrets yourself. For a working integration in one call, use aiden.upsert_integration_with_secrets.

vault.store_secret

Store a secret from a Vault body you assemble yourself.

vault.get_supported_metadata

List Vault categories, subcategories, and the keys each one expects.

Integration secrets → agent → Ask

find_supported_format

Import this helper and find one Vault category row by category and subcategory.

vault.list_secrets

List secrets, with optional filters.

vault.get_secret

Read one secret by id.

vault.update_secret

Update a secret by id.

vault.delete_secret

Delete a secret by id.

vault.store_grafana_secret

Store a Grafana URL and token.

vault.store_kafka_secret

Store Kafka bootstrap servers and optional SASL fields.

vault.store_generic_secret

Store an arbitrary key-value secret.

Context Graph

Call these on client.contextGraph (Python context_graph, Go ContextGraph) for workspace graph inventory, connectors, and search.

context_graph.health

Check Context Graph liveness.

Context Graph inventory

context_graph.ready

Check Context Graph readiness.

context_graph.get_workspace_status

Readiness + record counts + per-connector sync health in one call.

Context Graph inventory

context_graph.list_record_types

List record types in the workspace graph.

Context Graph inventory

context_graph.get_record

Read one record by type and id.

context_graph.query_records

Run a graph record query.

context_graph.get_schema

Fetch the full schema catalog.

context_graph.get_schema_type

Fetch schema for one record type.

context_graph.list_connectors

List available connectors.

context_graph.list_connector_sources

List configured connector sources.

context_graph.list_connector_syncs

Page connector sync history.

context_graph.get_connector_sync

Read one connector sync by id.

context_graph.start_connector_sync

Start an async connector sync and return its sync_id.

context_graph.sync_and_wait

Start a connector sync and poll until it settles.

Context Graph inventory

context_graph.list_connector_schedules

List connector sync schedules.

context_graph.set_connector_schedule_interval

Change how often one connector schedule runs.

context_graph.search_graph_tools

Search graph tools by query string or request body.

Context Graph inventory