Run workflows from anywhere
Anything built on the Visual Studio canvas, or saved from an agent run, has an id. Run it with variables, wait for the result, put it on a schedule, or trigger it from a webhook.
A workflow is a fixed sequence of browser steps, app actions and logic. Running one costs no AI credits (unless a step itself uses AI), which is why the agent's saveAsWorkflow option matters: do it once with AI, repeat it forever without.
Every run returns an execution id you can poll. Runs are queued and usually start within a minute; the finished record carries each step's output, and a webhookUrl gets a signed callback when it ends.
Three ways to run it
import { Prompteryx } from '@prompteryx/sdk'
const px = new Prompteryx({ apiKey: process.env.PROMPTERYX_API_KEY })
const workflows = await px.workflows.list()
const run = await px.workflows.runAndWait(workflows[0].id, {
input: { postcode: 'SW1A 1AA' }, // becomes {{postcode}} inside the workflow
execution: { runMode: 'headless' },
timeoutMs: 5 * 60_000,
})
console.log(run.status, run.outputs) // 'completed', { … }
// or start and check back later
const started = await px.workflows.run(workflows[0].id, { input: { postcode: 'SW1A 1AA' } })
const later = await px.executions.wait(started.executionId)
const logs = await px.executions.logs(started.executionId)npx prompteryx workflows list
npx prompteryx workflows run fHX8NlpAJxoWuAOll7zr --input postcode="SW1A 1AA" --wait
npx prompteryx runs logs api_…curl -X POST https://www.prompteryx.ai/api/v1/workflows/WORKFLOW_ID/execute \
-H "Authorization: Bearer px_live_YOUR_KEY" -H "Content-Type: application/json" \
-d '{"variables":{"postcode":"SW1A 1AA"},"options":{"runMode":"headless"},"webhookUrl":"https://your-server.com/done"}'
# → 202 { "success": true, "data": { "execution": { "id": "api_…", "status": "pending", "statusUrl": "…" } } }
curl https://www.prompteryx.ai/api/v1/executions/api_… -H "Authorization: Bearer px_live_YOUR_KEY"
# → { "data": { "execution": { "status": "COMPLETED", "outputs": { "Step name": { … } }, "nodeResults": [ … ] } } }"Run my 'Weekly bin day check' workflow and tell me the result."
# workflow_list → workflow_execute. Assistants can also create a workflow from a description,
# add steps to one, or record browser actions and save them as a workflow.// every weekday at 08:00 London time
await px.schedules.create({ workflowId: 'wf_…', cronExpression: '0 8 * * 1-5', timezone: 'Europe/London', input: { postcode: 'SW1A 1AA' } })Webhook triggers give a workflow its own URL that any service can POST to. See Webhooks.
Runs count against the plan's monthly executions. Browser steps use cloud minutes unless the run targets your local Chrome through the desktop app.
Full endpoint list with every field: REST API reference.