POST
/
v3
/
workflows
/
curl --request POST \
  --url https://agent-prod.studio.lyzr.ai/v3/workflows/ \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '{
  "flow_name": "Document Processing Flow",
  "flow_data": {
    "tasks": [
      {
        "name": "agent_1pli",
        "tag": "Lyzr Agent",
        "function": "call_lyzr_agent",
        "params": {
          "config": {
            "user_id": "a78576a2-4c17-4021-9bf6-fc96280115c9",
            "session_id": "e70d7d0a-1111-4222-aacc-123456789abc",
            "api_key": ""
          },
          "user_message": {
            "value": "Fetch all relevant documents for the user"
          }
        }
      },
      {
        "name": "agent_f8gd",
        "tag": "Lyzr Agent",
        "function": "call_lyzr_agent",
        "params": {
          "config": {
            "user_id": "8885f9bf-a8df-4848-af4f-9f79f4e7a07c",
            "session_id": "bbaaccee-1234-5678-abcd-87654321cdef",
            "api_key": ""
          },
          "agent_1pli": {
            "depends": "agent_1pli"
          },
          "user_message": {
            "value": "Generate the document plan based on user documents"
          }
        }
      }
    ],
    "default_inputs": {},
    "run_name": "Document Plan Run",
    "edges": []
  },
  "api_key": "sk-default-JDJARRky2GCw0vlk8ChKglquOkbHmYdK"
}'
{
  "message": "Workflow created successfully",
  "workflow_id": "123e4567-e89b-12d3-a456-426614174000"
}

Authorizations

x-api-key
string
header
required

Body

application/json

Response

201
application/json

Workflow successfully created

The response is of type object.