Check what a workflow still needs in an environment
const url = 'https://api.katara.com/katara/v1/orgs/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/environments/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/preflight?workflow=managed_runs';const options = {method: 'GET', headers: {cookie: 'katara_session=<katara_session>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url 'https://api.katara.com/katara/v1/orgs/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/environments/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/preflight?workflow=managed_runs' \ --cookie katara_session=<katara_session>Reads, without writing, locking or spending anything, what stands between this environment and each workflow, or the one named in workflow: whether this deployment runs the service, whether the environment has access to each product it uses, which credentials may start it, the permissions it needs and which the caller lacks, which records it needs are present, whether its background workers report ready, and the steps left, each marked when only a person can take it. Needs org:read; a key answers for its own environment only. Queue depths and other customers’ load are never reported.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Query Parameters
Section titled “Query Parameters”Check one workflow instead of all of them. Any other query parameter is refused.
Header Parameters
Section titled “Header Parameters”Optional mounted-account binding for cookie reads. A supplied different account returns account_changed.
Responses
Section titled “Responses”What each workflow still needs here.
A side-effect-free check of an environment for the caller who asked. Nothing is written, no record is locked and nothing is spent; present means present when it was read, and the operation that relies on a record checks it again. setup is the caller’s own setup under way, null for none and always null for a key.
object
object
Who asked. fresh is whether the caller is a person’s session that may make the operations asking for one; a key has no sign-in and is never fresh. permissions are what the caller may do here, as the organization read reports them.
object
How far a setup has come and the request it was started with. A setup is done once its first run is admitted and discarded once its person gives it up; while running, starting again with the same request continues it.
object
The starter agent to set up. A blank agent also carries the instructions and first task the person wrote; the other starters carry neither.
object
One step of a setup and whether it has finished.
object
What stands between the environment and one workflow. available is false when this deployment does not run the service, and message then says so in the words its operations’ feature_unavailable reply uses. For image_description it is also false when no model in the model catalog accepts images, or when the catalog could not be read; message says which. ready is true only when the service is available, the caller may start the workflow with this credential and holds every permission it needs, every product is granted, every item is present and every worker reports ready. A worker that has never reported is unknown, which is not ready.
object
A workflow a preflight checks: managed runs, document ingestion, tools that act with a connected credential, schedules, signed events, funded evaluation, and image descriptions in managed runs.
object
object
object
A record a workflow needs in the environment. The first eight are the setup flow’s steps of the same names. Product access is granted by Katara rather than made by an operation.
object
Background work, named for what it does: starting and advancing runs, carrying out run steps, reading documents, starting scheduled runs, admitting events and delivering notices.
One step left. action uses the words an error’s action does. A step about a record names it in item, the operation that makes it in operation and the permission that operation needs in permissions. requires_human is true when an API key or service account cannot take the step: only a signed-in person, or someone holding authority the caller lacks, can.
object
A record a workflow needs in the environment. The first eight are the setup flow’s steps of the same names. Product access is granted by Katara rather than made by an operation.
Background work, named for what it does: starting and advancing runs, carrying out run steps, reading documents, starting scheduled runs, admitting events and delivering notices.
Example
{ "environment": { "mode": "test", "state": "active" }, "caller": { "kind": "session", "role": "owner", "permissions": [ "billing:read" ] }, "setup": { "starter": "assistant", "request": { "starter": "assistant" }, "state": "running", "steps": [ { "name": "agent" } ] }, "workflows": [ { "workflow": "managed_runs", "product_access": [ { "product": "synapse", "action": "fund" } ], "credentials": [ "session" ], "permissions": { "required": [ "billing:read" ], "missing": [ "billing:read" ] }, "items": [ { "item": "agent" } ], "workers": [ { "worker": "runs", "state": "ready" } ], "next_actions": [ { "action": "sign_in", "item": "agent", "worker": "runs", "permissions": [ "billing:read" ] } ] } ]}default
Section titled “default”Request rejected or unavailable.
object
object
Stable; branch on it. Any operation can answer invalid_request, with param naming the refused field when there is one; human_session_required, when an API key, service account or workload calls an operation only a signed-in person may perform; reauthentication_required, when a person’s sign-in is too old for the operation; permission_denied; route_not_found and method_not_allowed, when no operation matches the path or method; and feature_unavailable, when the operation’s service is not enabled on this deployment.
The request field a refusal is about, such as the agent_id or run_id query parameter; null when the refusal is not about one field.
Example
{ "error": { "action": "sign_in" }}