Skip to content

Execution Mode 1: API (Single Endpoint)

The single endpoint API mode provides synchronous execution of autonomous flows. The API call waits for the flow to complete and returns the final result in the response.

Limitations:

  • Maximum execution time: 120-150 seconds
  • Not recommended for complex or multi-step flows
  • Best suited for simple, fast operations
POST https://app.phinite.ai/api/v1/ai/trigger/{workspace_id}/{trigger_id}/{environment}

The API accepts the following JSON payload:

{
"message": "",
"user_variables": {"key1":"value1", "key2":"value2"}
}
Field Type Description
message String The first message sent to the flow when the session starts. Can be empty if not required.
user_variables Object Session variables to initialize the conversation with. These variables will be available throughout the flow.

The API directly returns the completed or failed status:

Success Response (200 OK):

{
"workflow_id": "workflowid-uuid",
"response": {
"key1": "value1",
"key2": "value2"
},
"status": "completed",
"logs": [...],
"requires_input": false,
"error": null
}

Failed Response (200 OK):

{
"workflow_id": "workflowid-uuid",
"response": {},
"status": "failed",
"logs": [...],
"requires_input": false,
"error": "Error details here"
}