Skip to main content
POST
Create a new workflow

Overview

Create a new workflow to process queries against a knowledge engine. Workflows represent individual question-answer sessions that leverage your uploaded documents and data sources.

Error Handling

This endpoint can return various error responses. For comprehensive error handling information, see the Workflows Error Handling Guide.

Common Error Scenarios

Resolution: Wait for the knowledge engine to finish processing uploaded documents before creating workflows.
Resolution: Upload at least one document to the knowledge engine before creating workflows.
Resolution: Use a supported model name or omit the field to use the default model.
Resolution: Contact support to enable the model or use a different enabled model.

Best Practices

Pre-flight Validation

Always validate the knowledge engine status before creating workflows:

Error Handling

Implement proper error handling with retry logic for transient failures:

Authorizations

Authorization
string
header
required

Basic authentication header of the form Basic <encoded-value>, where <encoded-value> is the base64-encoded string username:password.

Body

application/json
name
string
required

Name of the workflow

Maximum string length: 50
Example:

"Fintech Companies"

query
string
required

The query to ask the knowledge engine

Example:

"What is the latest revenue of Square?"

knowledge_engine_id
string
required

ID of the knowledge engine this workflow belongs to

Example:

"kng_abc123xyz789"

type
enum<string>
required

Type of the workflow

Available options:
query
Example:

"query"

description
string

Short description of what the workflow is comprised of

Example:

"Workflow for processing and analyzing fintech companies"

context_id
string

Context ID used in case of thread mode for chat based workflows

Example:

"ctx_abc123xyz78910"

advanced_reasoning
boolean

Flag to enable advanced reasoning for the workflow

Example:

true

model
enum<string>

LLM to use for the query

Available options:
auto,
claude-4.5-sonnet,
llama-v3-70b,
llama-4-scout,
llama-4-maverick,
gemini-2.5,
gpt-5.4,
claude-4.6-haiku,
gpt-4.1
Example:

"llama-v3-70b"

Response

Workflow created successfully

id
string

Alphanumeric 14 character string identifier

Example:

"wfl_abc123xyz78910"

name
string

Name of the workflow

Example:

"Fintech Companies"

query
string

The query to ask the knowledge engine

Example:

"What is the latest revenue of Square?"

response
string

The response from the knowledge engine

Example:

"Square's latest revenue is $1.2 billion"

context_id
string

Context ID used in case of thread mode for chat based workflows

Example:

"ctx_abc123xyz78910"

advanced_reasoning
boolean

Flag to enable advanced reasoning for the workflow

Example:

true

model
enum<string>

LLM to use for the query

Available options:
auto,
claude-4.5-sonnet,
llama-v3-70b,
llama-4-scout,
llama-4-maverick,
gemini-2.5,
gpt-5.4,
claude-4.6-haiku,
gpt-4.1
Example:

"llama-v3-70b"

citations
object[]

List of citations referenced in the response, or null if no citations are available

status
enum<string>

Current status of the workflow

Available options:
PROCESSING,
PROCESSED
Example:

"PROCESSED"

created_at
integer<int64>

Unix timestamp when this entity was created

Example:

1679644800