Create an automation
Creates an automation and makes it live at once: its triggers start runs as soon as the request returns. The permissions on its steps are granted by this request; nobody approves them in the app.
Requires an API key whose user is a workspace owner or admin. Returns 422 when triggers is empty or the workspace cannot choose the requested model; omit model or send auto.
Required scope: automations:create
Rate limit category: Write
Body ParametersJSONExpand Collapse
steps: array of object { name, prompt, type, permissions } or object { command, name, type, 2 more } or object { duration, name, type, unit } What a run does, in order.
What a run does, in order.
AgentStep object { name, prompt, type, permissions }
permissions: optional array of object { name, type, reason } or object { connector, tools, type, reason } or object { scopes, type, reason } or object { domain, type, headers, 2 more } What the agent may use in this step. Defaults to none.
What the agent may use in this step. Defaults to none.
APIPermission object { scopes, type, reason }
NetworkPermission object { domain, type, headers, 2 more }
CodeStep object { command, name, type, 2 more }
permissions: optional array of object { scopes, type, reason } or object { domain, type, headers, 2 more } What the command may use. Defaults to none.
What the command may use. Defaults to none.
APIPermission object { scopes, type, reason }
NetworkPermission object { domain, type, headers, 2 more }
triggers: array of object { type } or object { type, exampleResult } or object { schedule, type } or 3 moreWhat starts a run.
What starts a run.
WebhookTrigger object { type, exampleResult }
exampleResult: optional object { json, parsed } A sample payload and the fields the steps read from it.
A sample payload and the fields the steps read from it.
json: map[string or number or boolean or 2 more] or array of string or number or boolean or 2 more
RecordUpdatedTrigger object { objectType, type, watchedFields, watchedRelationships }
Fields whose changes start a run, as field keys ($name for a built-in field, the slug for a custom one) or attribute definition IDs. With no field or relationship watches, runs on any change.
model: optional "auto" or "auto_low" or "auto_high" or 4 moreModel the agent steps run on. Returns 400 for an unsupported model and 422 when the workspace cannot choose the requested model; omit model or send auto.
Model the agent steps run on. Returns 400 for an unsupported model and 422 when the workspace cannot choose the requested model; omit model or send auto.
ReturnsExpand Collapse
AutomationCreateResponse object { id, createdAt, description, 10 more }
When its most recent failed run ended, test runs included; null if no run has failed.
runAs: object { type } or object { memberId, type } or object { type } Who the automation acts as.
Who the automation acts as.
steps: array of object { id, name, prompt, 2 more } or object { id, command, name, 3 more } or object { id, duration, name, 2 more }
AgentStep object { id, name, prompt, 2 more }
permissions: optional array of object { name, type, reason } or object { connector, tools, type, reason } or object { scopes, type, reason } or object { domain, type, headers, 2 more } What the agent may use in this step. Defaults to none.
What the agent may use in this step. Defaults to none.
APIPermission object { scopes, type, reason }
NetworkPermission object { domain, type, headers, 2 more }
CodeStep object { id, command, name, 3 more }
permissions: optional array of object { scopes, type, reason } or object { domain, type, headers, 2 more } What the command may use. Defaults to none.
What the command may use. Defaults to none.
APIPermission object { scopes, type, reason }
NetworkPermission object { domain, type, headers, 2 more }
triggers: array of object { type } or object { type, url, exampleResult } or object { schedule, type } or 3 more
WebhookTrigger object { type, url, exampleResult }
exampleResult: optional object { json, parsed } A sample payload and the fields the steps read from it.
A sample payload and the fields the steps read from it.
json: map[string or number or boolean or 2 more] or array of string or number or boolean or 2 more
Create an automation
curl https://api.lightfield.app/v1/automations \
-H 'Content-Type: application/json' \
-H 'Lightfield-Version: 2026-03-01' \
-H "Authorization: Bearer $API_KEY" \
-d '{
"name": "x",
"steps": [
{
"name": "x",
"prompt": "x",
"type": "AGENT"
}
],
"triggers": [
{
"type": "MANUAL"
}
]
}'{
"id": "id",
"createdAt": "createdAt",
"description": "description",
"lastFailureAt": "lastFailureAt",
"lastRunAt": "lastRunAt",
"model": "model",
"name": "x",
"objectType": "automation",
"runAs": {
"type": "WORKSPACE"
},
"status": "ACTIVE",
"steps": [
{
"id": "id",
"name": "x",
"prompt": "x",
"type": "AGENT",
"permissions": [
{
"name": "x",
"type": "TOOL",
"reason": "reason"
}
]
}
],
"triggers": [
{
"type": "MANUAL"
}
],
"updatedAt": "updatedAt"
}Returns Examples
{
"id": "id",
"createdAt": "createdAt",
"description": "description",
"lastFailureAt": "lastFailureAt",
"lastRunAt": "lastRunAt",
"model": "model",
"name": "x",
"objectType": "automation",
"runAs": {
"type": "WORKSPACE"
},
"status": "ACTIVE",
"steps": [
{
"id": "id",
"name": "x",
"prompt": "x",
"type": "AGENT",
"permissions": [
{
"name": "x",
"type": "TOOL",
"reason": "reason"
}
]
}
],
"triggers": [
{
"type": "MANUAL"
}
],
"updatedAt": "updatedAt"
}