> 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/save-workflow-results.md).

# Save Workflow Results

## Save the results of a workflow

You can save the workflow result (the output of the final step) directly to many target location via the following endpoint by changing the `type` parameter. The details for input parameters can be found in the table below:

| Parameter              | Type              | Description                                                                                |
| ---------------------- | ----------------- | ------------------------------------------------------------------------------------------ |
| `runTaskId`            | string            | The run task id that you want to save the results of                                       |
| `type`                 | enum              | allowed values are `convo`, `note`, `knowledge_base`, `insight_graph`                      |
| `convoId`              | string \| null    | The target dataroom to save, required if `type` is `convo`                                 |
| `knowledgeBases`       | string\[] \| null | The target databases slug to contribute, required if `type` is `knowledge_base`            |
| `typeInsightGraphType` | enum              | allowed values are `STATUS_QUO`, `VISION`, `LEGACY`, required if `type` is `insight_graph` |

## POST /cortex/executor/save-run-task-output

> Save Run Task Output To Note

```json
{"openapi":"3.1.0","info":{"title":"Blockbrain Knowledge Bots","version":"0.2.6"},"security":[{"HTTPBearer":[]}],"components":{"securitySchemes":{"HTTPBearer":{"type":"http","scheme":"bearer"}},"schemas":{"SaveRunTaskOutputDTO":{"properties":{"runTaskId":{"type":"string","title":"Runtaskid","default":""},"convoId":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Convoid"},"knowledgeBases":{"anyOf":[{"items":{"$ref":"#/components/schemas/SaveWorkflowResultToKnowledgRequest"},"type":"array"},{"type":"null"}],"title":"Knowledgebases"},"type":{"$ref":"#/components/schemas/OutputType","default":"convo"},"typeInsightGraphType":{"anyOf":[{"$ref":"#/components/schemas/InsightsGraphType"},{"type":"null"}]}},"type":"object","title":"SaveRunTaskOutputDTO"},"SaveWorkflowResultToKnowledgRequest":{"properties":{"knowledgeBase":{"type":"string","title":"Knowledgebase"},"folderPath":{"type":"string","title":"Folderpath","default":"root"}},"type":"object","required":["knowledgeBase"],"title":"SaveWorkflowResultToKnowledgRequest"},"OutputType":{"type":"string","enum":["convo","note","knowledge_base","insight_graph"],"title":"OutputType"},"InsightsGraphType":{"type":"string","enum":["STATUS_QUO","VISION","LEGACY"],"title":"InsightsGraphType"},"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/save-run-task-output":{"post":{"tags":["cortex","cortex executor"],"summary":"Save Run Task Output To Note","operationId":"save_run_task_output_to_note_cortex_executor_save_run_task_output_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SaveRunTaskOutputDTO"}}},"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"}}}}}}}}}
```


---

# 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/save-workflow-results.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.
