AgentWorkflow
Operations
Every route this entity exposes. Each route links to its own reference on this page.
| Method | Route | SDK operation | Returns |
|---|---|---|---|
POST |
/api/v1/organizations/{organization_id}/agents/{id}/spark/workflows |
create |
Native workflow catalog including the new workflow |
GET |
/api/v1/organizations/{organization_id}/agents/{id}/spark/workflows |
load |
Native Lobster workflow files for the selected agent |
PATCH |
/api/v1/organizations/{organization_id}/agents/{id}/spark/workflows |
update |
Updated native workflow catalog |
Examples
One example per SDK, generated from the API model. The argument names are the parameters and fields of this entity, and the values are placeholders. The examples are not compiled or executed.
Golang
Construct client as shown in the Golang setup, then call the operations:
agent_workflow, err := client.AgentWorkflow(nil).Load(map[string]any{"agent_id": "example", "organization_id": "example"}, nil)
if err != nil {
panic(err)
}
fmt.Println(agent_workflow)
created, err := client.AgentWorkflow(nil).Create(map[string]any{"agent_id": "example", "organization_id": "example", "path": "example", "template": "example"}, nil)
if err != nil {
panic(err)
}
fmt.Println(created)
updated, err := client.AgentWorkflow(nil).Update(map[string]any{"agent_id": "example", "organization_id": "example"}, nil)
if err != nil {
panic(err)
}
fmt.Println(updated)
Lua
Construct client as shown in the Lua setup, then call the operations:
local agent_workflow, err = client:AgentWorkflow():load({ agent_id = "example", organization_id = "example" })
local created, err = client:AgentWorkflow():create({ agent_id = "example", organization_id = "example", path = "example", template = "example" })
local updated, err = client:AgentWorkflow():update({ agent_id = "example", organization_id = "example" })
PHP
Construct client as shown in the PHP setup, then call the operations:
$agent_workflow = $client->AgentWorkflow()->load(["agent_id" => "example", "organization_id" => "example"]);
$created = $client->AgentWorkflow()->create(["agent_id" => "example", "organization_id" => "example", "path" => "example", "template" => "example"]);
$updated = $client->AgentWorkflow()->update(["agent_id" => "example", "organization_id" => "example"]);
Python
Construct client as shown in the Python setup, then call the operations:
agent_workflow = client.AgentWorkflow().load({"agent_id": "example", "organization_id": "example"})
created = client.AgentWorkflow().create({ "agent_id": "example", "organization_id": "example", "path": "example", "template": "example" })
updated = client.AgentWorkflow().update({"agent_id": "example", "organization_id": "example"})
Ruby
Construct client as shown in the Ruby setup, then call the operations:
agent_workflow = client.AgentWorkflow.load({ "agent_id" => "example", "organization_id" => "example" })
created = client.AgentWorkflow.create({ "agent_id" => "example", "organization_id" => "example", "path" => "example", "template" => "example" })
updated = client.AgentWorkflow.update({ "agent_id" => "example", "organization_id" => "example" })
TypeScript
Construct client as shown in the TypeScript setup, then call the operations:
const agent_workflow = await client.AgentWorkflow().load({ agent_id: "example", organization_id: "example" })
const created = await client.AgentWorkflow().create({ agent_id: "example", organization_id: "example", path: "example", template: "example" })
const updated = await client.AgentWorkflow().update({ agent_id: "example", organization_id: "example" })
Fields
| Field | Type | Required | Description |
|---|---|---|---|
can_manage |
boolean |
Yes | Can Manage |
expected_digest |
string |
Yes | Expected Digest |
path |
string |
Yes | Path |
source |
string |
Yes | At most 262144 UTF-8 bytes |
template |
string |
Yes | A template id from the catalog's templates |
templates |
array |
Yes | Templates |
truncated |
boolean |
Yes | Truncated |
workflows |
array |
Yes | Workflows |
create
POST /api/v1/organizations/{organization_id}/agents/{id}/spark/workflows
Operation ID: post_api_v1_organizations_organization_id_agents_id_spark_workflows.
Authentication: bearer token (bearerAuth).
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
organization_id |
path |
string |
Yes | |
id |
path |
string |
Yes |
Request body
application/json
| Property | Type | Required | Description |
|---|---|---|---|
path |
string |
Yes | |
template |
string |
Yes | A template id from the catalog's templates |
Responses
201: Native workflow catalog including the new workflow
application/json
| Property | Type | Required | Description |
|---|---|---|---|
can_manage |
boolean |
Yes | |
templates |
array of object |
Yes | |
templates[].args |
array of object |
Yes | |
templates[].args[].default |
string |
Yes | |
templates[].args[].description |
string |
Yes | |
templates[].args[].name |
string |
Yes | |
templates[].description |
string |
Yes | |
templates[].grants |
array of object |
Yes | |
templates[].grants[].granted |
boolean |
Yes | Whether this agent holds the grant now. Rails checks repository_write and pull_request_write against the agent's work repository grants and GitHub connections; a grant it cannot check is false. |
templates[].grants[].id |
string |
Yes | |
templates[].grants[].label |
string |
Yes | |
templates[].id |
string |
Yes | |
templates[].models |
array of string |
Yes | |
templates[].name |
string |
Yes | |
truncated |
boolean |
Yes | |
workflows |
array of object |
Yes | |
workflows[].definition |
object |
Yes | |
workflows[].diagnostics |
array of string |
Yes | |
workflows[].digest |
string |
Yes | |
workflows[].error |
string |
Yes | |
workflows[].name |
string |
Yes | |
workflows[].path |
string |
Yes | |
workflows[].pipeline_checkpoints |
object |
Yes | |
workflows[].pipeline_commands |
object |
Yes | |
workflows[].source |
string |
Yes |
401: Unauthorized
403: Current agent management authority required
404: Agent not found
409: A workflow exists at the path (workflow_exists), an output schema exists with different content (workflow_schema_conflict), or the file could not be written (workflow_write_unavailable)
410: This gateway uses saved Temporal workflows (workflow_files_retired)
422: Invalid path or unknown template
503: The agent is unavailable
load
GET /api/v1/organizations/{organization_id}/agents/{id}/spark/workflows
Operation ID: spark_workflows_api_v1_organization_persistent_agent.
Authentication: bearer token (bearerAuth).
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
organization_id |
path |
string |
Yes | |
id |
path |
string |
Yes | |
view |
query |
enum: summary |
No | List workflow names and descriptions. |
workflow_path |
query |
string |
No | Read the full definition for one workflow. Cannot be used with view. |
Responses
200: Native Lobster workflow files for the selected agent
application/json
The response is object or object.
401: Unauthorized
403: Forbidden
404: Not found
410: This gateway uses saved Temporal workflows (workflow_files_retired)
422: Unprocessable entity
502: Bad gateway
update
PATCH /api/v1/organizations/{organization_id}/agents/{id}/spark/workflows
Operation ID: patch_api_v1_organizations_organization_id_agents_id_spark_workflows.
Authentication: bearer token (bearerAuth).
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
organization_id |
path |
string |
Yes | |
id |
path |
string |
Yes |
Request body
application/json
| Property | Type | Required | Description |
|---|---|---|---|
expected_digest |
string |
Yes | |
path |
string |
Yes | |
source |
string |
Yes | At most 262144 UTF-8 bytes |
Responses
200: Updated native workflow catalog
application/json
| Property | Type | Required | Description |
|---|---|---|---|
can_manage |
boolean |
Yes | |
templates |
array of object |
Yes | |
templates[].args |
array of object |
Yes | |
templates[].args[].default |
string |
Yes | |
templates[].args[].description |
string |
Yes | |
templates[].args[].name |
string |
Yes | |
templates[].description |
string |
Yes | |
templates[].grants |
array of object |
Yes | |
templates[].grants[].granted |
boolean |
Yes | Whether this agent holds the grant now. Rails checks repository_write and pull_request_write against the agent's work repository grants and GitHub connections; a grant it cannot check is false. |
templates[].grants[].id |
string |
Yes | |
templates[].grants[].label |
string |
Yes | |
templates[].id |
string |
Yes | |
templates[].models |
array of string |
Yes | |
templates[].name |
string |
Yes | |
truncated |
boolean |
Yes | |
workflows |
array of object |
Yes | |
workflows[].definition |
object |
Yes | |
workflows[].diagnostics |
array of string |
Yes | |
workflows[].digest |
string |
Yes | |
workflows[].error |
string |
Yes | |
workflows[].name |
string |
Yes | |
workflows[].path |
string |
Yes | |
workflows[].pipeline_checkpoints |
object |
Yes | |
workflows[].pipeline_commands |
object |
Yes | |
workflows[].source |
string |
Yes |