For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Dashboard
User GuideDeveloper GuidesAPI Reference
User GuideDeveloper GuidesAPI Reference
  • Runtype API
      • GETList flows
      • POSTCreate flow
      • GETGet flow details
      • PUTUpdate flow
      • DELDelete flow
      • GETList flow step results
      • POSTPublish flow
      • POSTRun flow on records of a type
      • GETExport flow for runtime
Dashboard
LogoLogo
Runtype APIFlows

Run flow on records of a type

POST
/v1/flows/:id/run-on-record-type
POST
/v1/flows/:id/run-on-record-type
$curl -X POST https://api.runtype.com/v1/flows/id/run-on-record-type \
> -H "Authorization: Bearer <token>" \
> -H "Content-Type: application/json" \
> -d '{
> "recordType": "customer"
>}'
1{
2 "success": true,
3 "batchId": "batch_9f8b7c6d5e4a3b2c1d0e",
4 "flowId": "flow_123abc456def789ghi",
5 "recordType": "customer",
6 "recordCount": 5,
7 "status": "completed",
8 "executedImmediately": true,
9 "successCount": 4,
10 "failureCount": 1,
11 "completedAt": "2024-06-10T15:45:30Z",
12 "results": [
13 {
14 "recordId": "cust_001",
15 "recordName": "Acme Corporation",
16 "success": true,
17 "executionId": "exec_789xyz123abc",
18 "executionTime": 2.3,
19 "contextSteps": 3,
20 "promptsExecuted": 2,
21 "error": ""
22 },
23 {
24 "recordId": "cust_002",
25 "recordName": "Beta Industries",
26 "success": true,
27 "executionId": "exec_456def789ghi",
28 "executionTime": 1.8,
29 "contextSteps": 2,
30 "promptsExecuted": 2,
31 "error": ""
32 },
33 {
34 "recordId": "cust_003",
35 "recordName": "Gamma LLC",
36 "success": false,
37 "executionId": "exec_123abc456def",
38 "executionTime": 0.9,
39 "contextSteps": 1,
40 "promptsExecuted": 1,
41 "error": "Timeout error during execution"
42 },
43 {
44 "recordId": "cust_004",
45 "recordName": "Delta Co",
46 "success": true,
47 "executionId": "exec_321cba654fed",
48 "executionTime": 2,
49 "contextSteps": 3,
50 "promptsExecuted": 2,
51 "error": ""
52 },
53 {
54 "recordId": "cust_005",
55 "recordName": "Epsilon Enterprises",
56 "success": true,
57 "executionId": "exec_654fed321cba",
58 "executionTime": 1.5,
59 "contextSteps": 2,
60 "promptsExecuted": 2,
61 "error": ""
62 }
63 ]
64}

Execute a flow against every record of the given type. Small batches (≤10) execute immediately and return 200; larger batches return 202 with a scheduled batchId.

Was this page helpful?
Previous

Export flow for runtime

Next
Built with

Authentication

AuthorizationBearer
API key or Clerk session token

Path parameters

idstringRequired

Request

This endpoint expects an object.
recordTypestringRequired>=1 character

Response

Batch executed immediately
successboolean
batchIdstring
flowIdstring
recordTypestring
recordCountinteger
statusenum
Allowed values:
executedImmediatelyboolean
successCountinteger
failureCountinteger
completedAtstring
resultslist of objects

Errors

400
Bad Request Error
401
Unauthorized Error
403
Forbidden Error
429
Too Many Requests Error
500
Internal Server Error