> For the complete documentation index, see [llms.txt](https://api.docs.blockbrain.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://api.docs.blockbrain.ai/getting-started/workflows/run-a-workflow.md).

# Run a Workflow

## Get list of existing workflows

Workflows are attached to a workshop bot. The list of existing workflows in a bot are provided via the get workshop bot details endpoint, which require the `bot_id`. The result you are looking for should be found in the `workflows` field:

## GET /cortex/bot/detail/{bot\_id}

> Get Detail Pre Defined Cortex

```json
{"openapi":"3.1.0","info":{"title":"Blockbrain Knowledge Bots","version":"0.2.6"},"security":[{"HTTPBearer":[]}],"components":{"securitySchemes":{"HTTPBearer":{"type":"http","scheme":"bearer"}},"schemas":{"CortexBotDetail":{"properties":{"_id":{"type":"string","title":"Id"},"createdAt":{"type":"string","format":"date-time","title":"Createdat"},"modifiedAt":{"type":"string","format":"date-time","title":"Modifiedat"},"parentCortexBot":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Parentcortexbot"},"isOwner":{"type":"boolean","title":"Isowner","default":false},"botTemplate":{"$ref":"#/components/schemas/BotTemplateType","default":"nexus"},"iconSignedUrl":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Iconsignedurl"},"name":{"type":"string","title":"Name"},"systemMessage":{"type":"string","title":"Systemmessage"},"defaultGreetings":{"type":"string","title":"Defaultgreetings"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","default":""},"isPublic":{"type":"boolean","title":"Ispublic","default":false},"isDefaultBot":{"type":"boolean","title":"Isdefaultbot","default":false},"iconUrl":{"type":"string","title":"Iconurl"},"tags":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Tags","default":[]},"followUp":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Followup"},"isEnableInitialQuestions":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Isenableinitialquestions","default":false},"followUpPrompt":{"type":"string","title":"Followupprompt"},"elvLabApiKey":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Elvlabapikey"},"voiceId":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Voiceid"},"ttsOption":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ttsoption"},"enableAutoResponse":{"type":"boolean","title":"Enableautoresponse","default":false},"enableVisualRetrieval":{"type":"boolean","title":"Enablevisualretrieval","default":false},"enableVoiceInput":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Enablevoiceinput","default":true},"enableInlineCitation":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Enableinlinecitation","default":false},"isReferencesEnabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Isreferencesenabled","default":true},"searchMethodType":{"anyOf":[{"$ref":"#/components/schemas/SearchMethodType"},{"type":"null"}],"default":1},"model":{"$ref":"#/components/schemas/AIModel"},"modelsFavorites":{"anyOf":[{"items":{"$ref":"#/components/schemas/AIModel"},"type":"array"},{"type":"null"}],"title":"Modelsfavorites"},"agentsFavorites":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Agentsfavorites"},"topk":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Topk"},"advanceOptions":{"$ref":"#/components/schemas/ConvoAdvanceOptions","default":{"temperature":0.7,"topP":1,"presencePenalty":0,"frequencyPenalty":0}},"knowledgeBase":{"anyOf":[{"type":"string"},{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Knowledgebase"},"contributedDatabase":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Contributeddatabase","default":[]},"strategies":{"items":{"$ref":"#/components/schemas/CortexStrategy"},"type":"array","title":"Strategies","default":[]},"summaryPrompt":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Summaryprompt","default":""},"workflows":{"anyOf":[{"items":{"$ref":"#/components/schemas/WorkflowDetailedDTO"},"type":"array"},{"type":"null"}],"title":"Workflows","default":[]},"advancedSetting":{"anyOf":[{"$ref":"#/components/schemas/AdvancedSettingDetailedDTO"},{"type":"null"}]},"enableDefaultIntentAgent":{"type":"boolean","title":"Enabledefaultintentagent","default":false},"enableDefaultWebSearch":{"type":"boolean","title":"Enabledefaultwebsearch","default":false},"defaultWebSearchConfig":{"anyOf":[{"$ref":"#/components/schemas/DefaultWebSearchConfig"},{"type":"null"}]},"mobileAccessMode":{"anyOf":[{"$ref":"#/components/schemas/MobileAccessMode"},{"type":"null"}],"default":"off"},"chatMode":{"anyOf":[{"$ref":"#/components/schemas/ChatMode"},{"type":"null"}],"default":"normal"},"dataRetentionConfig":{"anyOf":[{"$ref":"#/components/schemas/DataRetentionConfig"},{"type":"null"}]},"agent":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Agent"},"agentsConfig":{"anyOf":[{"additionalProperties":{"$ref":"#/components/schemas/AgentConfig"},"type":"object"},{"type":"null"}],"title":"Agentsconfig"}},"type":"object","required":["_id","createdAt","modifiedAt","name","systemMessage","defaultGreetings","iconUrl","followUpPrompt","model"],"title":"CortexBotDetail"},"BotTemplateType":{"type":"string","enum":["retriever","nexus"],"title":"BotTemplateType"},"SearchMethodType":{"type":"integer","enum":[1,2,3],"title":"SearchMethodType"},"AIModel":{"type":"string","enum":["gpt-3.5-turbo","gpt-4","gpt-4-1106-preview","gpt-4-vision","gpt-4o","gpt-4o-mini","gpt-45","gpt-5","gpt-5-mini","gpt-5-nano","gpt-5-chat","openai-o1","openai-o1-mini","openai-o3-mini","openai-o3","openai-o4-mini","openai-o3-pro","openai-gpt-4o-realtime-audio","azure-gpt-35-turbo","azure-gpt-4","azure-gpt-4-turbo","azure-gpt-4-turbo-vision","azure-gpt-4o","azure-gpt-4o-mini","azure-gpt-41","azure-gpt-41-mini","azure-gpt-41-nano","azure-gpt-5","azure-gpt-5-mini","azure-gpt-5-nano","azure-gpt-5-chat","azure-model-router","azure-openai-o1","azure-openai-o1-mini","azure-openai-o3-mini","azure-openai-o3","azure-openai-o4-mini","azure-openai-o3-pro","azure-gpt-4o-realtime-audio","azure-ai-deepseek-r1-us","anthropic-claude-v3-opus","anthropic-claude-v3-sonnet","anthropic-claude-v3-haiku","anthropic-claude-v3.5-sonnet","anthropic-claude-v3.5-sonnet-v2","anthropic-claude-v3.7-sonnet","anthropic-claude-v3.7-sonnet-thinking-mode","anthropic-claude-opus-4","anthropic-claude-sonnet-4","anthropic-claude-opus-4.1","google-gemini","google-gemini-1.0-vision","google-gemini-1.5-pro","google-gemini-1.5-flash","google-gemini-2.0-flash","google-gemini-2.0-flash-thinking-mode","google-gemini-2.0-flash-lite","google-gemini-2.5-pro","google-gemini-2.5-flash","google-gemini-2.5-flash-lite","google-vertex-gemma-2","google-vertex-mistral-large","google-vertex-mistral-nemo","google-vertex-codestral","google-anthropic-claude-v3-opus","google-anthropic-claude-v3-sonnet","google-anthropic-claude-v3-haiku","google-anthropic-claude-v3.5-sonnet","google-anthropic-claude-v3.5-sonnet-v2","google-anthropic-claude-v3.5-haiku","google-anthropic-claude-v3.7-sonnet","google-anthropic-claude-v3.7-sonnet-thinking-mode","google-anthropic-claude-opus-4","google-anthropic-claude-sonnet-4","google-anthropic-claude-opus-4.1","google-llama-405b-maas","google-llama-70b-maas","google-llama-8b-maas","google-llama-32-90b-vision-maas","google-llama-4-scout-17b-16e-maas","google-llama-4-maverick-17b-128e-maas","google-vertex-ai21-jamba-large","google-vertex-ai21-jamba-mini","deepseek-chat-v3","deepseek-reasoner","nebius-deepseek-chat-v3","nebius-deepseek-r1","xai-grok-3","xai-grok-3-mini","xai-grok-3-mini-thinking-mode","xai-grok-2-vision","xai-grok-4","mistral-medium","mistral-small","mistral-large","magistral-medium"],"title":"AIModel"},"ConvoAdvanceOptions":{"properties":{"temperature":{"type":"number","maximum":2,"minimum":0,"title":"Temperature","default":0.7},"topP":{"type":"number","maximum":1,"minimum":0,"title":"Topp","default":1},"presencePenalty":{"type":"number","maximum":2,"minimum":-2,"title":"Presencepenalty","default":0},"frequencyPenalty":{"type":"number","maximum":2,"minimum":-2,"title":"Frequencypenalty","default":0}},"type":"object","title":"ConvoAdvanceOptions"},"CortexStrategy":{"properties":{"name":{"type":"string","title":"Name"},"slug":{"type":"string","title":"Slug","default":""},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","default":""},"icon":{"type":"string","title":"Icon","description":"icon key from heroicons","default":""},"actions":{"items":{"$ref":"#/components/schemas/CortextAction"},"type":"array","title":"Actions"},"scopes":{"items":{"$ref":"#/components/schemas/CortexStrategyScope"},"type":"array","title":"Scopes","default":["scope-bot","scope-user"]},"isDefault":{"type":"boolean","title":"Isdefault","default":true}},"type":"object","required":["name","actions"],"title":"CortexStrategy"},"CortextAction":{"properties":{"name":{"type":"string","title":"Name"},"slug":{"type":"string","title":"Slug","default":""},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","default":""},"icon":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Icon","description":"icon key from heroicons","default":""},"prompt":{"type":"string","title":"Prompt"},"isDefault":{"type":"boolean","title":"Isdefault","default":true}},"type":"object","required":["name","prompt"],"title":"CortextAction"},"CortexStrategyScope":{"type":"string","enum":["scope-user","scope-bot"],"title":"CortexStrategyScope"},"WorkflowDetailedDTO":{"properties":{"_id":{"type":"string","title":"Id"},"createdAt":{"type":"string","format":"date-time","title":"Createdat"},"modifiedAt":{"type":"string","format":"date-time","title":"Modifiedat"},"botId":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Botid"},"name":{"type":"string","title":"Name"},"description":{"type":"string","title":"Description"},"isDefault":{"type":"boolean","title":"Isdefault","default":false},"runModeDefault":{"$ref":"#/components/schemas/WorkFlowRunMode","default":"run_all_step"},"isDefaultContext":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Isdefaultcontext","default":false},"workflowSteps":{"anyOf":[{"items":{"anyOf":[{"$ref":"#/components/schemas/WorkflowIntegrationStepDetailedDTO"},{"$ref":"#/components/schemas/WorkflowPromptStepDetailedDTO"}]},"type":"array"},{"type":"null"}],"title":"Workflowsteps","default":[]}},"type":"object","required":["_id","createdAt","modifiedAt","name","description"],"title":"WorkflowDetailedDTO"},"WorkFlowRunMode":{"type":"string","enum":["step_by_step","run_all_step"],"title":"WorkFlowRunMode"},"WorkflowIntegrationStepDetailedDTO":{"properties":{"workflowId":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Workflowid"},"stepType":{"$ref":"#/components/schemas/WorkflowStepType","description":"Type of the step, e.g., 'prompt' or 'integration'","default":"prompt"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name","description":"Name of the step, applicable to 'prompt' steps"},"runModeDefault":{"$ref":"#/components/schemas/WorkFlowStepRunMode","default":"run_all_step"},"apiUrl":{"type":"string","maxLength":2083,"minLength":1,"format":"uri","title":"Apiurl","description":"The endpoint URL for the integration API."},"attachPreviousStepOutput":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Attachpreviousstepoutput","description":"Attach previous step output.","default":false},"auth":{"anyOf":[{"oneOf":[{"$ref":"#/components/schemas/WorkflowIntegrationStepAuthenticationBasic"},{"$ref":"#/components/schemas/WorkflowIntegrationStepAuthenticationBearer"}],"discriminator":{"propertyName":"type","mapping":{"basic":"#/components/schemas/WorkflowIntegrationStepAuthenticationBasic","bearer":"#/components/schemas/WorkflowIntegrationStepAuthenticationBearer"}}},{"type":"null"}],"title":"Auth","description":"Authentication details for the integration API."},"headers":{"items":{"$ref":"#/components/schemas/WorkflowIntegrationStepHeader"},"type":"array","title":"Headers","description":"Optional headers to include in the API request.","default":[]},"payload":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Payload","description":"Optional payload to include in the API request."},"queryParams":{"items":{"$ref":"#/components/schemas/WorkflowIntegrationStepQueryParam"},"type":"array","title":"Queryparams","description":"Optional query parameters to include in the API request.","default":[]},"method":{"type":"string","enum":["GET","POST","PUT","PATCH","DELETE","OPTIONS","HEAD"],"title":"Method","description":"HTTP method to use, e.g., 'GET', 'POST'.","default":"GET"},"timeout":{"type":"integer","title":"Timeout","description":"Timeout for the API request in seconds.","default":10},"retries":{"type":"integer","title":"Retries","description":"Number of retries for the API request.","default":3},"_id":{"type":"string","title":"Id"},"createdAt":{"type":"string","format":"date-time","title":"Createdat"},"modifiedAt":{"type":"string","format":"date-time","title":"Modifiedat"}},"type":"object","required":["apiUrl","_id","createdAt","modifiedAt"],"title":"WorkflowIntegrationStepDetailedDTO"},"WorkflowStepType":{"type":"string","enum":["prompt","integration"],"title":"WorkflowStepType"},"WorkFlowStepRunMode":{"type":"string","enum":["step_by_step","run_all_step"],"title":"WorkFlowStepRunMode"},"WorkflowIntegrationStepAuthenticationBasic":{"properties":{"type":{"type":"string","const":"basic","title":"Type","description":"The authentication type.","default":"basic"},"username":{"type":"string","title":"Username","description":"The username for basic authentication."},"password":{"type":"string","title":"Password","description":"The password for basic authentication."}},"type":"object","required":["username","password"],"title":"WorkflowIntegrationStepAuthenticationBasic"},"WorkflowIntegrationStepAuthenticationBearer":{"properties":{"type":{"type":"string","const":"bearer","title":"Type","description":"The authentication type.","default":"bearer"},"token":{"type":"string","title":"Token","description":"The token for bearer authentication."}},"type":"object","required":["token"],"title":"WorkflowIntegrationStepAuthenticationBearer"},"WorkflowIntegrationStepHeader":{"properties":{"key":{"type":"string","title":"Key","description":"The header key."},"value":{"type":"string","title":"Value","description":"The header value."},"isActive":{"type":"boolean","title":"Isactive","description":"Whether the header should be activated.","default":true}},"type":"object","required":["key","value"],"title":"WorkflowIntegrationStepHeader"},"WorkflowIntegrationStepQueryParam":{"properties":{"key":{"type":"string","title":"Key","description":"The header key."},"value":{"type":"string","title":"Value","description":"The header value."},"isActive":{"type":"boolean","title":"Isactive","description":"Whether the header should be activated.","default":true}},"type":"object","required":["key","value"],"title":"WorkflowIntegrationStepQueryParam"},"WorkflowPromptStepDetailedDTO":{"properties":{"workflowId":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Workflowid"},"stepType":{"$ref":"#/components/schemas/WorkflowStepType","description":"Type of the step, e.g., 'prompt' or 'integration'","default":"prompt"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name","description":"Name of the step, applicable to 'prompt' steps"},"runModeDefault":{"$ref":"#/components/schemas/WorkFlowStepRunMode","default":"run_all_step"},"prompt":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Prompt","description":"Prompt for the user, applicable to 'prompt' steps"},"model":{"anyOf":[{"$ref":"#/components/schemas/AIModel"},{"type":"null"}],"description":"Applicable only to 'prompt' steps"},"advanceOptions":{"$ref":"#/components/schemas/AdvanceOptions","default":{"temperature":0.7,"topP":1,"presencePenalty":0,"frequencyPenalty":0}},"isWebSearchEnabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Iswebsearchenabled","default":false},"webSearchType":{"anyOf":[{"$ref":"#/components/schemas/WebSearchType"},{"type":"null"}],"default":"normal_web_search"},"webSearchConfig":{"anyOf":[{"$ref":"#/components/schemas/WebSearchConfig"},{"type":"null"}]},"_id":{"type":"string","title":"Id"},"createdAt":{"type":"string","format":"date-time","title":"Createdat"},"modifiedAt":{"type":"string","format":"date-time","title":"Modifiedat"}},"type":"object","required":["_id","createdAt","modifiedAt"],"title":"WorkflowPromptStepDetailedDTO"},"AdvanceOptions":{"properties":{"temperature":{"type":"number","maximum":2,"minimum":0,"title":"Temperature","default":0.7},"topP":{"type":"number","maximum":1,"minimum":0,"title":"Topp","default":1},"presencePenalty":{"type":"number","maximum":2,"minimum":-2,"title":"Presencepenalty","default":0},"frequencyPenalty":{"type":"number","maximum":2,"minimum":-2,"title":"Frequencypenalty","default":0}},"type":"object","title":"AdvanceOptions"},"WebSearchType":{"type":"string","enum":["normal_web_search","pro_web_search","pro_r_web_search"],"title":"WebSearchType"},"WebSearchConfig":{"properties":{"webSearchProvider":{"$ref":"#/components/schemas/WebSearchProvider","default":"linkup_normal_web_search"},"isLinkupDeepSearch":{"type":"boolean","title":"Islinkupdeepsearch","default":false}},"type":"object","title":"WebSearchConfig"},"WebSearchProvider":{"type":"string","enum":["linkup_normal_web_search","linkup_pro_web_search","linkup_pro_r_web_search","tavily_normal_web_search","tavily_pro_web_search","tavily_pro_r_web_search","perplexity_normal_web_search","perplexity_pro_web_search"],"title":"WebSearchProvider"},"AdvancedSettingDetailedDTO":{"properties":{"botId":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Botid"},"advancedFeatures":{"items":{"$ref":"#/components/schemas/AdvancedFeatureDTO"},"type":"array","title":"Advancedfeatures","default":[]},"actionButtons":{"items":{"$ref":"#/components/schemas/ActionButtonDTO"},"type":"array","title":"Actionbuttons","default":[]}},"type":"object","title":"AdvancedSettingDetailedDTO"},"AdvancedFeatureDTO":{"properties":{"key":{"type":"string","title":"Key"},"isActive":{"type":"boolean","title":"Isactive","default":false}},"type":"object","required":["key"],"title":"AdvancedFeatureDTO"},"ActionButtonDTO":{"properties":{"key":{"type":"string","title":"Key"},"isRight":{"type":"boolean","title":"Isright","default":false},"index":{"type":"number","title":"Index"},"isActive":{"type":"boolean","title":"Isactive","default":false}},"type":"object","required":["key","index"],"title":"ActionButtonDTO"},"DefaultWebSearchConfig":{"properties":{"webSearchProvider":{"$ref":"#/components/schemas/WebSearchProvider","default":"linkup_normal_web_search"}},"type":"object","title":"DefaultWebSearchConfig"},"MobileAccessMode":{"type":"string","enum":["off","on_v1","on_v2"],"title":"MobileAccessMode"},"ChatMode":{"type":"string","enum":["normal","system_agent","code_interpreter","schunk_sap_agent","harting_agent"],"title":"ChatMode"},"DataRetentionConfig":{"properties":{"isTemporary":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Istemporary"},"retentionPeriodDay":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Retentionperiodday"},"enableDataRetention":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Enabledataretention"}},"type":"object","title":"DataRetentionConfig"},"AgentConfig":{"properties":{"capabilities":{"additionalProperties":{"$ref":"#/components/schemas/AgentConfigCapability"},"type":"object","title":"Capabilities"}},"type":"object","title":"AgentConfig"},"AgentConfigCapability":{"properties":{"enabled":{"type":"boolean","title":"Enabled"}},"type":"object","required":["enabled"],"title":"AgentConfigCapability"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}},"paths":{"/cortex/bot/detail/{bot_id}":{"get":{"tags":["cortex","cortex bot"],"summary":"Get Detail Pre Defined Cortex","operationId":"get_detail_pre_defined_cortex_cortex_bot_detail__bot_id__get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CortexBotDetail"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}}}
```

Example of a list of workflows:

```json
{
  "workflows": [
    {
      "_id": "668e3c20aab00720ed055c3e",
      "createdAt": "2024-07-10T07:45:36.023662",
      "modifiedAt": "2025-01-14T13:34:05.213017",
      "botId": "65c38e71d42e8f8525efdba6",
      "name": "Patentsx",
      "description": "This is a descriptionx",
      "isDefault": false,
      "runModeDefault": "run_all_step",
      "workflowSteps": [
        {
          "workflowId": "668e3c20aab00720ed055c3e",
          "stepType": "prompt",
          "name": "Extraction",
          "runModeDefault": "run_all_step",
          "prompt": "Identify and outline all potential risks, unusual formulations, and potential legal red flags in the document(s). Discuss the implications of these risks and suggest mitigating strategies if applicable. Generate a list of critical questions raised by the document. These questions should provoke thought, clarify uncertainties, or explore areas for further investigation. Ensure your responses are user-friendly, engaging, and easy to understand, even for individuals without a legal background.",
          "model": "anthropic-claude-v3.5-sonnet",
          "advanceOptions": {
            "temperature": 0.0,
            "topP": 1.0,
            "presencePenalty": 0.0,
            "frequencyPenalty": 0.0
          },
          "isWebSearchEnabled": true,
          "_id": "668e3c20aab00720ed055c3f",
          "createdAt": "2025-01-14T13:34:05.258280",
          "modifiedAt": "2025-01-14T13:34:05.258280"
        },
        ...
    }
  ]
}
```

Save the `_id` field as we will need it to invoke the workflow.

## Invoking a workflow

With the workflow `_id` we get from the previous step, we should be able to invoke the workflow using the `executor` endpoint:

Parameters table:

| Parameter    | Type     | Description                                                               |
| ------------ | -------- | ------------------------------------------------------------------------- |
| `workflowId` | `string` | The ID of the workflow to invoke                                          |
| `convoId`    | `string` | The ID of the data room to be provided to the workflow as input / context |

## POST /cortex/executor

> Create Action Executor Workflow

```json
{"openapi":"3.1.0","info":{"title":"Blockbrain Knowledge Bots","version":"0.2.6"},"security":[{"HTTPBearer":[]}],"components":{"securitySchemes":{"HTTPBearer":{"type":"http","scheme":"bearer"}},"schemas":{"WorkflowExecutorRequest":{"properties":{"messageId":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Messageid"},"convoId":{"type":"string","title":"Convoid"},"workflowId":{"type":"string","title":"Workflowid"},"attackmentId":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Attackmentid"},"action":{"anyOf":[{"$ref":"#/components/schemas/RunControllerAction"},{"type":"null"}],"default":"continue"},"wcpOwnerId":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Wcpownerid"}},"type":"object","required":["convoId","workflowId"],"title":"WorkflowExecutorRequest"},"RunControllerAction":{"type":"string","enum":["re-run","re-run-to-end","continue","next","back","step","step_to_end","continue_to_end"],"title":"RunControllerAction"},"CommonResponseDTO":{"properties":{"code":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Code"},"key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Key"},"body":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Body"}},"type":"object","title":"CommonResponseDTO"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}},"paths":{"/cortex/executor":{"post":{"tags":["cortex","cortex executor"],"summary":"Create Action Executor Workflow","operationId":"create_action_executor_workflow_cortex_executor_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkflowExecutorRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CommonResponseDTO"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}}}
```

Upon triggering the endpoint, you should receive a response back with the **`runTaskId`** of the workflow run. You can then use the **`runTaskId`** to check the status of the workflow run.

```json
{
  "code": 200,
  "key": "workflow-run-success",
  "body": {
    "convoId": "6606841895b41b9b1b6abc78",
    "runTaskId": "679212cfe5a93310cb06314d"
  }
}
```

## Next Step

Now that your workflow is running, let's [Get a Workflow Results](/getting-started/workflows/get-a-workflow-results.md).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://api.docs.blockbrain.ai/getting-started/workflows/run-a-workflow.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
