Skip to content
中文

Automation

Automation combines platform capabilities into scripts and workflows that you run on demand or start with a trigger.

ObjectPurpose
ScriptTypeScript that executes from start to finish and returns one result.
WorkflowA YAML process with step checkpoints, waiting and suspension.
ActionA reusable capability with input and output schemas, called from a script or workflow.
RunOne execution of a script or workflow, including its input, output, status and calls.
TriggerStarts a published script or workflow on a schedule or when a webhook arrives.

Choose an entry point

Use a script for a calculation, batch job or sequence of API calls. Use a workflow when work must wait across time or resume from checkpoints. Package a shared capability as an action. Actions are called inside scripts or workflows; they have no standalone run endpoint.

Rerunning a failed script executes it from the beginning. Effects that already occurred are not rolled back. Add a trigger to a published target when it should run automatically.

Run once

Create an API Key in Console and set PRAXIS_API_KEY. In Bash with curl and jq installed, this sends a Bearer-authenticated request and adds one without calling a model:

终端窗口
export PRAXIS_API_URL="https://api.deepraxis.com"
: "${PRAXIS_API_KEY:?Set PRAXIS_API_KEY to your API Key}"
curl --fail-with-body -sS "$PRAXIS_API_URL/automation/v1/runs" \
-H "Authorization: Bearer $PRAXIS_API_KEY" \
-H 'Content-Type: application/json' \
--data '{"source":"export default async (input: { n: number }) => ({ answer: input.n + 1 });","language":"ts","input":{"n":41},"wait":60}' \
| jq '{id,status,output,error}'

Expected: status: "completed" and output: {"answer":42}. If still pending or running, save the returned id as RUN_ID and read the result. The quickstart also shows how to save and publish this script.

Next steps

API reference → · Cookbook →

Workflow syntax reference: fields, data flow and the supported DSL subset.