cloud_agent_tasks
Creates, updates, deletes, gets or lists a cloud_agent_tasks resource.
Overview​
| Name | cloud_agent_tasks |
| Type | Resource |
| Id | railway.agents.cloud_agent_tasks |
Fields​
The following fields are returned by SELECT queries:
- list
One row per CloudAgentTask. Task lifecycle and correlation. Read cloudAgentTask for the latest session response.
| Name | Datatype | Description |
|---|---|---|
id | string | |
cloud_agent_id | string | |
requested_by_user_id | string | |
session_id | string | |
completed_at | string (date-time) | |
created_at | string (date-time) | |
created_via | string | (API, MCP) |
error | string | |
external_ref | string | |
metadata | object | |
prompt_preview | string | |
started_at | string (date-time) | |
status | string | (AWAITING_INPUT, COMPLETED, FAILED, PENDING, RUNNING) |
Methods​
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
list | select | environment_id | status | List task lifecycle records in an environment, newest first. Backed by the Railway GraphQL query cloudAgentTasks. |
dispatch | exec | environment_id, project_id, prompt | agent_name, cloud_agent_id, external_ref, idempotency_key, metadata, mode, output_schema, reply_to_task_id, session_id, source, webhook_secret, webhook_url | Start a task and return its handle. Creates a fresh agent by default; replyToTaskId continues the original conversation. Backed by the Railway GraphQL mutation cloudAgentTaskDispatch. |
Parameters​
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
environment_id | string | |
status | string | |
agent_name | string | |
cloud_agent_id | string | Explicit agent reuse. Omit all targets to create a fresh agent. |
external_ref | string | |
idempotency_key | string | |
metadata | object | |
mode | string | (FOLLOW_UP, PROMPT, STEER) |
output_schema | object | JSON Schema object for structured output; requires PROMPT mode. |
project_id | string | |
prompt | string | |
reply_to_task_id | string | Continue this task's original agent/session. Mutually exclusive with cloudAgentId/sessionId. |
session_id | string | Existing session to continue; requires cloudAgentId. |
source | object | JSON object of GraphQL type CloudAgentSourceInput; keys keep the API's camelCase names. |
webhook_secret | string | |
webhook_url | string |
SELECT examples​
- list
List task lifecycle records in an environment, newest first. Backed by the Railway GraphQL query cloudAgentTasks.
SELECT
id,
cloud_agent_id,
requested_by_user_id,
session_id,
completed_at,
created_at,
created_via,
error,
external_ref,
metadata,
prompt_preview,
started_at,
status
FROM railway.agents.cloud_agent_tasks
WHERE environment_id = '{{ environment_id }}' -- required
AND status = '{{ status }}'
;
Lifecycle Methods​
- dispatch
Start a task and return its handle. Creates a fresh agent by default; replyToTaskId continues the original conversation. Backed by the Railway GraphQL mutation cloudAgentTaskDispatch.
EXEC railway.agents.cloud_agent_tasks.dispatch
@environment_id='{{ environment_id }}', --required
@project_id='{{ project_id }}', --required
@prompt='{{ prompt }}', --required
@agent_name='{{ agent_name }}',
@cloud_agent_id='{{ cloud_agent_id }}',
@external_ref='{{ external_ref }}',
@idempotency_key='{{ idempotency_key }}',
@metadata='{{ metadata }}',
@mode='{{ mode }}',
@output_schema='{{ output_schema }}',
@reply_to_task_id='{{ reply_to_task_id }}',
@session_id='{{ session_id }}',
@source='{{ source }}',
@webhook_secret='{{ webhook_secret }}',
@webhook_url='{{ webhook_url }}'
;