mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +00:00
feat(core): Implement lifecycle hooks to support streaming responses (no-changelog) (#16391)
This commit is contained in:
@@ -919,6 +919,7 @@ export type IExecuteFunctions = ExecuteFunctions.GetNodeParameterFn &
|
||||
putExecutionToWait(waitTill: Date): Promise<void>;
|
||||
sendMessageToUI(message: any): void;
|
||||
sendResponse(response: IExecuteResponsePromiseData): void;
|
||||
sendChunk(type: ChunkType, content?: IDataObject | string): void;
|
||||
|
||||
// TODO: Make this one then only available in the new config one
|
||||
addInputData(
|
||||
@@ -2094,7 +2095,12 @@ export interface IWebhookResponseData {
|
||||
}
|
||||
|
||||
export type WebhookResponseData = 'allEntries' | 'firstEntryJson' | 'firstEntryBinary' | 'noData';
|
||||
export type WebhookResponseMode = 'onReceived' | 'lastNode' | 'responseNode' | 'formPage';
|
||||
export type WebhookResponseMode =
|
||||
| 'onReceived'
|
||||
| 'lastNode'
|
||||
| 'responseNode'
|
||||
| 'formPage'
|
||||
| 'streaming';
|
||||
|
||||
export interface INodeTypes {
|
||||
getByName(nodeType: string): INodeType | IVersionedNodeType;
|
||||
@@ -2325,6 +2331,8 @@ export interface IWorkflowExecutionDataProcess {
|
||||
data?: ITaskData;
|
||||
};
|
||||
agentRequest?: AiAgentRequest;
|
||||
httpResponse?: express.Response; // Used for streaming responses
|
||||
streamingEnabled?: boolean;
|
||||
}
|
||||
|
||||
export interface ExecuteWorkflowOptions {
|
||||
@@ -2916,3 +2924,14 @@ export type IPersonalizationSurveyAnswersV4 = {
|
||||
reportedSource?: string | null;
|
||||
reportedSourceOther?: string | null;
|
||||
};
|
||||
|
||||
export type ChunkType = 'begin' | 'item' | 'end' | 'error';
|
||||
export interface StructuredChunk {
|
||||
type: ChunkType;
|
||||
content?: string;
|
||||
metadata: {
|
||||
nodeId: string;
|
||||
nodeName: string;
|
||||
timestamp: number;
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user