Skip to main content
Powerdrill Enterprise Open API supports streaming responses to clients, enabling partial results for specific requests. This functionality is implemented using the Server-Sent Events (SSE) standard.

How to understand streaming responses

The response to each request consists of a series of response blocks. When streaming mode is enabled for a request, Powerdrill will send real-time updates to the client, delivering continuous response blocks as they becomes available. The structure of a response block is as follows:
Each streaming response block contains the following fields:
  • id and groupId: The ID of the group to which the response block belongs. A group in the streaming response is a collection of response blocks. For example, in a general job, each step in the Analyze stage is a group, and the entire Respond stage is a group.
  • content: The content of the response block, which varies with the block type. For more details, see Content description.
  • created: The timestamp indicating when the content was created.
  • groupId: The ID of the group to which the response block belongs.
  • groupName: The name of the group, such as Conclusions.
  • stage: The stage to which the response block belongs. Two stages are available: Analyze and Respond.

Content description

The value of content in each response block varies with the block content type:
  • When the block content type is MESSAGE: The content is a piece of text.
  • When the block content type is CODE: The content is a code snippet in Markdown format.
  • When the block content type is TABLE: The content represents a table, consisting of:
    • name: The .csv file name.
    • url: The S3 key or URL to the file.
    • expires_at: The expiration time for url. To save the table for future use, make sure to download it before it expires.
  • When the block content type is IMAGE: The content represents an image, consisting of:
    • name: The image name.
    • url: The S3 key or URL to the image.
    • expires_at: The expiration time for url. To save the image for future use, make sure to download it before it expires.
  • When the block content type is SOURCES: The content represents the source of the response block, including:
    • source: The file name of the data source.
    • datasourceId: The ID of the data source.
    • datasetId: The ID of the dataset.
    • fileType: The name extension of the data source file.
  • When the block content type is QUESTIONS: The content represents follow-up questions suggested by Powerdrill.
Let’s see an example.
For details about the POST /v1/jobs endpoint, see Create job.
Python request
The response is simlilar to this:
However, if streaming is disabled, Powerdrill returns the response only after the entire response is ready. Let’s use the same request as an example for a clear comparison. The only difference is that stream is set to False.
The response looks like this:
Example response

Need more help?

Post to our help community

Get answers from our members

Contact us

Tell us more and we’ll help you out