Workflow

Add Step

POST
Create a new workflow step

Path parameters

workflow_idstringRequired

Request

This endpoint expects an object.
order
integerRequired
agentId
stringRequired

Response

This endpoint returns an object
success
boolean
data
objectOptional
Represents a WorkflowStep record
POST
1curl -X POST https://api.beta.superagent.sh/api/v1/workflows/workflow_id/steps \
2 -H "Authorization: Bearer <token>" \
3 -H "Content-Type: application/json" \
4 -d '{
5 "order": 1,
6 "agentId": "agentId"
7}'
200
Successful
1{
2 "success": true,
3 "data": {
4 "id": "id",
5 "order": 1,
6 "workflowId": "workflowId",
7 "createdAt": "2024-01-15T09:30:00Z",
8 "updatedAt": "2024-01-15T09:30:00Z",
9 "agentId": "agentId",
10 "workflow": {
11 "id": "id",
12 "name": "name",
13 "createdAt": "2024-01-15T09:30:00Z",
14 "updatedAt": "2024-01-15T09:30:00Z",
15 "apiUserId": "apiUserId",
16 "description": "description",
17 "apiUser": {
18 "id": "id",
19 "createdAt": "2024-01-15T09:30:00Z",
20 "updatedAt": "2024-01-15T09:30:00Z"
21 },
22 "workflowConfigs": [
23 {
24 "id": "id",
25 "createdAt": "2024-01-15T09:30:00Z",
26 "updatedAt": "2024-01-15T09:30:00Z",
27 "workflowId": "workflowId"
28 }
29 ]
30 },
31 "input": "input",
32 "output": "output",
33 "agent": {
34 "id": "id",
35 "type": "SUPERAGENT",
36 "name": "name",
37 "description": "description",
38 "isActive": true,
39 "createdAt": "2024-01-15T09:30:00Z",
40 "updatedAt": "2024-01-15T09:30:00Z",
41 "apiUserId": "apiUserId",
42 "avatar": "avatar",
43 "initialMessage": "initialMessage",
44 "llms": [
45 {
46 "agentId": "agentId",
47 "llmId": "llmId",
48 "createdAt": "2024-01-15T09:30:00Z",
49 "updatedAt": "2024-01-15T09:30:00Z"
50 }
51 ],
52 "llmModel": "GPT_3_5_TURBO",
53 "prompt": "prompt",
54 "apiUser": {
55 "id": "id",
56 "createdAt": "2024-01-15T09:30:00Z",
57 "updatedAt": "2024-01-15T09:30:00Z"
58 },
59 "datasources": [
60 {
61 "agentId": "agentId",
62 "datasourceId": "datasourceId",
63 "createdAt": "2024-01-15T09:30:00Z",
64 "updatedAt": "2024-01-15T09:30:00Z"
65 }
66 ],
67 "tools": [
68 {
69 "agentId": "agentId",
70 "toolId": "toolId",
71 "createdAt": "2024-01-15T09:30:00Z",
72 "updatedAt": "2024-01-15T09:30:00Z"
73 }
74 ],
75 "metadata": {
76 "key": "value"
77 },
78 "outputSchema": "outputSchema"
79 }
80 }
81}