feat: Send node execution finished and node execution data in separate events (no-changelog) (#18875)

Co-authored-by: Tomi Turtiainen <10324676+tomi@users.noreply.github.com>
This commit is contained in:
Alex Grozav
2025-09-12 13:56:13 +01:00
committed by GitHub
parent 26f27efd75
commit 10fa3a9b01
28 changed files with 325 additions and 159 deletions

View File

@@ -52,23 +52,36 @@ export type NodeExecuteBefore = {
};
};
/**
* Message sent after a node has finished executing that contains all that node's data
* except for the output items which are sent in the `NodeExecuteAfterData` message.
*/
export type NodeExecuteAfter = {
type: 'nodeExecuteAfter';
data: {
executionId: string;
nodeName: string;
data: ITaskData;
data: Omit<ITaskData, 'data'>;
itemCount: number;
};
};
/**
* Message sent after a node has finished executing that contains the entire output data
* of that node. This is sent immediately after `NodeExecuteAfter`.
*/
export type NodeExecuteAfterData = {
type: 'nodeExecuteAfterData';
data: {
executionId: string;
nodeName: string;
/**
* When a worker relays updates about a manual execution to main, if the
* payload size is above a limit, we send only a placeholder to the client.
* Later we fetch the entire execution data and fill in any placeholders.
*
* When sending a placheolder, we also send the number of output items, so
* the client knows ahead of time how many items are there, to prevent the
* items count from jumping up when the execution finishes.
*/
itemCount?: number;
data: ITaskData;
itemCount: number;
};
};
@@ -78,4 +91,5 @@ export type ExecutionPushMessage =
| ExecutionFinished
| ExecutionRecovered
| NodeExecuteBefore
| NodeExecuteAfter;
| NodeExecuteAfter
| NodeExecuteAfterData;