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
    • Overview
  • Runtype API
      • GETList flows
      • POSTCreate flow
      • GETGet flow details
      • PUTUpdate flow
      • DELDelete flow
      • GETExport flow for runtime (limited preview)
      • POSTPublish flow
      • POSTRun flow on records of a type
      • GETList flow step results
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: <apiKey>" \
> -H "Content-Type: application/json" \
> -d '{
> "recordType": "customer"
>}'
1{
2 "batchId": "batch_9f8b7c6d5e4a3b2c1d0e",
3 "completedAt": "2024-06-10T16:45:00Z",
4 "executedImmediately": true,
5 "failureCount": 0,
6 "flowId": "flow_123abc456def789ghi",
7 "recordCount": 5,
8 "recordType": "customer",
9 "results": [
10 {
11 "recordId": "cust_9876543210",
12 "recordName": "Acme Corporation",
13 "success": true,
14 "contextSteps": 3,
15 "error": "",
16 "executionId": "exec_001a2b3c4d5e6f7g8h9i",
17 "executionTime": 0.75,
18 "promptsExecuted": 2
19 },
20 {
21 "recordId": "cust_1234567890",
22 "recordName": "Beta Industries",
23 "success": true,
24 "contextSteps": 2,
25 "error": "",
26 "executionId": "exec_002b3c4d5e6f7g8h9i0j",
27 "executionTime": 0.6,
28 "promptsExecuted": 1
29 },
30 {
31 "recordId": "cust_1122334455",
32 "recordName": "Gamma LLC",
33 "success": true,
34 "contextSteps": 4,
35 "error": "",
36 "executionId": "exec_003c4d5e6f7g8h9i0j1k",
37 "executionTime": 0.85,
38 "promptsExecuted": 3
39 },
40 {
41 "recordId": "cust_6677889900",
42 "recordName": "Delta Co",
43 "success": true,
44 "contextSteps": 1,
45 "error": "",
46 "executionId": "exec_004d5e6f7g8h9i0j1k2l",
47 "executionTime": 0.5,
48 "promptsExecuted": 1
49 },
50 {
51 "recordId": "cust_5544332211",
52 "recordName": "Epsilon Enterprises",
53 "success": true,
54 "contextSteps": 2,
55 "error": "",
56 "executionId": "exec_005e6f7g8h9i0j1k2l3m",
57 "executionTime": 0.7,
58 "promptsExecuted": 2
59 }
60 ],
61 "status": "completed",
62 "success": true,
63 "successCount": 5
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

List flow step results

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
batchIdstring
completedAtstring
executedImmediatelyboolean
failureCountinteger
flowIdstring
recordCountinteger
recordTypestring
resultslist of objects
statusenum
Allowed values:
successboolean
successCountinteger

Errors

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