feat(core): Implement lifecycle hooks to support streaming responses (no-changelog) (#16391)

This commit is contained in:
Benjamin Schroth
2025-06-24 15:38:03 +02:00
committed by GitHub
parent c4a50df824
commit 1086914080
19 changed files with 752 additions and 11 deletions

View File

@@ -266,6 +266,15 @@ export class WorkflowRunner {
this.activeExecutions.resolveResponsePromise(executionId, response);
});
if (data.streamingEnabled) {
if (data.executionMode !== 'manual') {
lifecycleHooks.addHandler('sendChunk', (chunk) => {
data.httpResponse?.write(JSON.stringify(chunk) + '\n');
data.httpResponse?.flush?.();
});
}
}
additionalData.setExecutionStatus = WorkflowExecuteAdditionalData.setExecutionStatus.bind({
executionId,
});