@archastro/sdk
    Preparing search index...
    Index

    Constructors

    Methods

    Constructors

    Methods

    • Invoke an automation Triggers a single run of an automation that has type: "invoked". Returns the resulting automation run object, which you can use to poll or display run status. Both server-to-server (secret key) and user (publishable key + JWT) auth are supported. The automation's invoke_auth setting controls which auth modes are accepted; requests using an unsupported mode are rejected with 403. For server-to-server callers the run executes under the identity configured in the automation's run_as_user or run_as_agent fields. For authenticated user callers the invoking user's identity is used automatically. If you supply an idempotency_key, a second request with the same key returns the existing run rather than creating a new one.

      • payload — free-form invoke input. This is the workflow parameters: validated against input_schema when configured, stored as event_payload, and becomes the workflow $ after trigger unwrap (e.g. {{$.bug}} for {"bug":"upload fails"}).
      • participants — optional map of symbolic participant refs to agent ids for distributed embed_agent nodes, e.g. {"investigator":"agi_...","evaluator":"agi_..."}. Stored in the run's top-level participants field (not inside free-form payload) and exposed to workflows through their system context. Same top-level payload + participants shape as routine invoke.

      Parameters

      • automation: string

        Automation ID (auto_...) or lookup_key of the automation to invoke.

      • input: {
            idempotency_key?: string;
            participants?: Record<string, unknown>;
            payload?: Record<string, unknown>;
        }

        Request body.

        • Optionalidempotency_key?: string

          Unique key to deduplicate concurrent or retried invocations. A second request with the same key returns the existing run instead of creating a new one.

        • Optionalparticipants?: Record<string, unknown>

          Map of symbolic participant refs to agent ids (agi_... or UUID) for distributed embed_agent handoffs. Stored in the run's top-level participants field.

        • Optionalpayload?: Record<string, unknown>

          Free-form invoke input — the workflow parameters. Validated against the automation's input_schema when configured. Stored as event_payload and becomes the workflow $ after trigger unwrap (e.g. {{$.bug}}).

      Returns Promise<AutomationRun>

      The automation run created by this invocation.