n8n
Version:
n8n Workflow Automation Tool
148 lines (147 loc) • 4.39 kB
TypeScript
import type { AgentIntegrationConfig, ChatHubMessageStatus, InstanceAiEvent, PushMessage, WorkerStatus, WorkflowPublicationStatusMessage } from '@n8n/api-types';
import type { IWorkflowBase, WorkflowActivateMode } from 'n8n-workflow';
export type PubSubCommandMap = {
'reload-license': never;
'restart-event-bus': never;
'reload-external-secrets-providers': never;
'reload-overwrite-credentials': never;
'reload-oidc-config': never;
'reload-saml-config': never;
'reload-sso-provisioning-configuration': never;
'reload-source-control-config': never;
'reload-mcp-registry': never;
'reload-otel-config': never;
'reload-instance-ai-settings': never;
'community-package-install': {
packageName: string;
packageVersion: string;
};
'community-package-update': {
packageName: string;
packageVersion: string;
};
'community-package-uninstall': {
packageName: string;
};
'get-worker-id': never;
'get-worker-status': {
requestingUserId: string;
};
'stop-execution': {
executionId: string;
};
'add-webhooks-triggers-and-pollers': {
workflowId: string;
activeVersionId: string;
activationMode: WorkflowActivateMode;
};
'remove-triggers-and-pollers': {
workflowId: string;
};
'display-workflow-activation': {
workflowId: string;
activeVersionId: string;
};
'display-workflow-deactivation': {
workflowId: string;
};
'workflow-publish-wake-up': never;
'display-workflow-activation-error': {
workflowId: string;
errorMessage: string;
errorDescription?: string;
nodeId?: string;
};
'display-workflow-publication-status': WorkflowPublicationStatusMessage;
'relay-execution-lifecycle-event': PushMessage & {
pushRef: string;
asBinary: boolean;
};
'clear-test-webhooks': {
webhookKey: string;
workflowEntity: IWorkflowBase;
pushRef: string;
};
'relay-chat-stream-event': {
eventType: 'execution-begin' | 'execution-end' | 'begin' | 'chunk' | 'end' | 'error';
userId: string;
sessionId: string;
messageId: string;
sequenceNumber: number;
payload: {
previousMessageId?: string | null;
retryOfMessageId?: string | null;
executionId?: number | null;
content?: string;
status?: ChatHubMessageStatus;
error?: string;
};
};
'relay-instance-ai-event': {
threadId: string;
storedEvent: {
id?: number;
event: InstanceAiEvent;
};
};
'relay-instance-ai-task-control': {
threadId: string;
taskId?: string;
action: 'correct' | 'cancel-task' | 'cancel-thread' | 'clear-thread';
correction?: string;
};
'relay-chat-human-message': {
userId: string;
sessionId: string;
messageId: string;
previousMessageId: string | null;
content: string;
attachments: Array<{
id: string;
fileName: string;
mimeType: string;
}>;
};
'relay-chat-message-edit': {
userId: string;
sessionId: string;
revisionOfMessageId: string;
messageId: string;
content: string;
attachments: Array<{
id: string;
fileName: string;
mimeType: string;
}>;
};
'cancel-test-run': {
testRunId: string;
};
'cancel-collection': {
collectionId: string;
};
'agent-chat-integration-changed': {
agentId: string;
integration: AgentIntegrationConfig;
action: 'connect' | 'disconnect';
};
'agent-chat-subscription-changed': {
agentId: string;
integration: AgentIntegrationConfig;
threadId: string;
action: 'subscribe' | 'unsubscribe';
};
'agent-config-changed': {
agentId: string;
};
'agent-tasks-changed': {
agentId: string;
};
'redaction-floor-changed': never;
};
export type PubSubWorkerResponseMap = {
'response-to-get-worker-status': WorkerStatus & {
requestingUserId: string;
};
};
export type PubSubEventMap = PubSubCommandMap & PubSubWorkerResponseMap;