POST
/
api
/
v1
/
workflows
curl --request POST \
  --url https://api.getdecisional.ai/api/v1/workflows \
  --header 'Content-Type: application/json' \
  --data '{
  "value": {
    "name": "Revenue Analysis",
    "query": "What is the latest revenue of Square?",
    "description": "Workflow to analyze financial metrics of fintech companies",
    "context_id": "ctx_abc123xyz789",
    "advanced_reasoning": true,
    "model": "llama-v3-70b"
  }
}'
{
  "value": {
    "id": "wfl_abc123xyz789",
    "name": "Revenue Analysis",
    "query": "What is the latest revenue of Square?",
    "response": "Square's latest revenue is $1.2 billion <source_id=1>",
    "context_id": "ctx_abc123xyz789",
    "advanced_reasoning": true,
    "model": "llama-v3-70b",
    "citations": [
      {
        "citation_key": "<source_id=1>",
        "data_source_id": "dsc_n5kdefxua5fnrd",
        "file_name": "report.pdf",
        "page_number": 4
      }
    ],
    "status": "PROCESSED",
    "created_at": 1679644800
  }
}

Body

application/json
name
string
required

Name of the workflow

Maximum 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-3.5-sonnet,
llama-v3-70b,
o1,
o3-mini,
gpt-4o
Example:

"llama-v3-70b"

Response

201
application/json
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-3.5-sonnet,
llama-v3-70b,
o1,
o3-mini,
gpt-4o
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

Unix timestamp when this entity was created

Example:

1679644800