# Stream Pipeline Workspace

<Heading
  as={"h1"}
  className={"openapi__heading"}
  children={"Stream Pipeline Workspace"}
>
</Heading>

<MethodEndpoint
  method={"post"}
  path={"/api/v1/workspaces/{workspace_name}/haystack/pipelines/stream"}
  context={"endpoint"}
>
  
</MethodEndpoint>

Streams a haystack pipeline execution with Server-Sent Events (SSE) format in workspace scope.

This endpoint executes a Haystack pipeline and streams the results as they become available.
The response uses Server-Sent Events (SSE) format with the following event types:

- **delta**: Content chunks from streaming-capable components (e.g., LLM generators)
- **tool_call_delta**: Structured tool call events (if `include_tool_calls` is `true`)
- **tool_call_result**: Tool call results (if include_tool_call_results is True)
- **reasoning**: Reasoning steps emitted by the pipeline (if include_reasoning is True)
- **result**: Final pipeline result (if include_result is True)
- **error**: Error messages if pipeline execution fails

When `include_tool_calls` is set to `rendered`, tool calls are emitted as markdown text in `delta` events.

<Heading
  id={"request"}
  as={"h2"}
  className={"openapi-tabs__heading"}
  children={"Request"}
>
</Heading>

<ParamsDetails
  parameters={[{"description":"Type the name of the workspace.","in":"path","name":"workspace_name","required":true,"schema":{"description":"Type the name of the workspace.","title":"Workspace Name","type":"string"}},{"in":"query","name":"secret","required":false,"schema":{"default":"","title":"Secret","type":"string"}},{"in":"query","name":"ttl_seconds","required":false,"schema":{"default":600,"title":"Ttl Seconds","type":"integer"}}]}
>
  
</ParamsDetails>

<RequestSchema
  title={"Body"}
  body={{"content":{"application/json":{"schema":{"properties":{"chat_history_limit":{"default":3,"description":"The number of the most recent chat history items to include in the chat. For example, setting the limit to 3 will show the last three","title":"Chat History Limit","type":"integer"},"files":{"anyOf":[{"items":{"format":"uuid","type":"string"},"type":"array"},{"type":"null"}],"description":"A list of files in the workspace.","title":"Files"},"include_outputs_from":{"anyOf":[{"items":{"type":"string"},"type":"array","uniqueItems":true},{"type":"null"}],"description":"Optional component names to include outputs from. If not provided, all outputs will be included.","title":"Include Outputs From"},"include_reasoning":{"default":false,"description":"Includes the reasoning output under key 'reasoning' when set to `true`. Defaults to `false`.\nThe reasoning output may include the intermediate steps taken by the model to arrive at the final answer. Example reasoning output:\n```json\n{\"query_id\": \"e2084408-48f8-4f52-9b59-43dd924705ef\", \"type\": \"reasoning\", \"reasoning\": {\"reasoning_text\": \"This is the plan:\\nStep 1: Retrieve documents\\nStep 2: Process documents\\nStep 3: Generate answer\", \"extra\": {}}}\n```","title":"Include Reasoning","type":"boolean"},"include_result":{"default":false,"description":"Whether to include the final pipeline result in the stream.","title":"Include Result","type":"boolean"},"include_tool_call_results":{"default":false,"description":"Whether to include tool call result events in the stream.","title":"Include Tool Call Results","type":"boolean"},"include_tool_calls":{"anyOf":[{"type":"boolean"},{"const":"rendered","type":"string"}],"default":false,"description":"Tool call streaming mode. Set to `true` for structured `tool_call_delta` events, or to `rendered` to embed tool calls as markdown text in `delta` events.","title":"Include Tool Calls"},"inputs":{"additionalProperties":{"additionalProperties":true,"type":"object"},"description":"Input data for the pipeline run.","title":"Inputs","type":"object"},"pipeline_config":{"additionalProperties":true,"description":"Pipeline configuration as a dictionary containing components, connections, and other pipeline settings.","title":"Pipeline Config","type":"object"},"pipeline_id":{"description":"Unique identifier of a pipeline.","format":"uuid","title":"Pipeline ID","type":"string"},"pipeline_version_id":{"anyOf":[{"format":"uuid","type":"string"},{"type":"null"}],"description":"The version of pipeline used to execute the query.","title":"Pipeline Version ID"},"query":{"description":"The search query.","title":"Query","type":"string"},"search_session_id":{"anyOf":[{"format":"uuid","type":"string"},{"type":"null"}],"description":"The ID of the search session you want to use for chat.","title":"Search Session ID"}},"required":["pipeline_id","query","pipeline_config"],"title":"StreamPipelineRequest","type":"object"}}},"required":true}}
>
  
</RequestSchema>

<StatusCodes
  id={undefined}
  label={undefined}
  responses={{"200":{"content":{"application/json":{"schema":{}},"text/event-stream":{}},"description":"Streaming response from pipeline execution."},"400":{"description":"Run failed due to invalid pipeline configuration, parameters or input."},"422":{"content":{"application/json":{"schema":{"properties":{"detail":{"items":{"properties":{"ctx":{"title":"Context","type":"object"},"input":{"title":"Input"},"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"title":"Location","type":"array"},"msg":{"title":"Message","type":"string"},"type":{"title":"Error Type","type":"string"}},"required":["loc","msg","type"],"title":"ValidationError","type":"object"},"title":"Detail","type":"array"}},"title":"HTTPValidationError","type":"object"}}},"description":"Validation Error"}}}
>
  
</StatusCodes>
