Skip to content

Commit 95f8d85

Browse files
committed
Telegram vector ingestion only supports message and edited message events
1 parent 71017c5 commit 95f8d85

1 file changed

Lines changed: 9 additions & 7 deletions

File tree

src/workflows/telegram/TelegramEventWorkflow.ts

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,13 @@ export async function TelegramEventWorkflow({
3131
);
3232
}
3333

34-
const vectorIngestionWorkflow = await startChild('TelegramVectorIngestionWorkflow', {
35-
taskQueue: 'TEMPORAL_QUEUE_HEAVY',
36-
args: [{ event, update }],
37-
workflowId: `telegram:vector-ingestion:${update.update_id}`,
38-
});
39-
40-
await vectorIngestionWorkflow.result();
34+
// Vector ingestion only supports message and edited message events
35+
if (event === TelegramEvent.MESSAGE || event === TelegramEvent.EDITED_MESSAGE) {
36+
const vectorIngestionWorkflow = await startChild('TelegramVectorIngestionWorkflow', {
37+
taskQueue: 'TEMPORAL_QUEUE_HEAVY',
38+
args: [{ event, update }],
39+
workflowId: `telegram:vector-ingestion:${update.update_id}`,
40+
});
41+
await vectorIngestionWorkflow.result();
42+
}
4143
}

0 commit comments

Comments
 (0)