🎯 Purpose
WorkflowRequestResponse is a response from an external service to WorkflowFunctionRequest.
These responses are used by the dispatcher to build the next step
and to provide the final result via API.
🧭 Where it is used
Key places:
apps/workflows/consumer.py- find new responses (
received=False) - set
final=Truefor the last step
- find new responses (
apps/api/v1/workflows/views.py/workflows/result— get final response/workflows/csv-result— CSV export/workflows/debug— debug trace
🧩 Fields used in code
The following fields are referenced directly in code:
request— reference toWorkflowFunctionRequestdata— response payloadreceived— “response processed by dispatcher” flagfinal— “final workflow step” flagid— response identifierworkflow— used for CSV filename
Full field list is in
webpush.apps.workflows.models.
📄 Data format
/csv-result logic:
- take
response.data.get('result', {}) - if it contains
list[dict], CSV is generated - otherwise returns
204 No Content
🔁 Lifecycle
- Response is created by an external service
- Initially
received=False - Dispatcher marks
received=True - If the step is the last one —
final=True, result is available at/result