support_tickets_context that fetches PDF attachments from S3, extracts their text into a structured field, and then triggers embedding generation automatically.
Prerequisites
- Completed Data sources and sync —
support_tickets_contexthas a data source. - Read ExuluContext — configuration — the Processor section.
- Read ExuluStorage — you use
utils.storageto fetch files.
When processors run
A processor runs after an item is written to the context. Thetrigger value controls when:
In the current IMP source,
onInsert, onUpdate, and always all run on both writes — treat them as equivalent for write-triggered processing. Use manual when you want to control processing explicitly.
When generateEmbeddings: true is set in the processor config, IMP triggers embedding generation automatically after execute returns a result. This is the standard pattern for PDF processing: the processor converts the file to text, returns the enriched item, and embeddings are generated from the new content.
1
Add the attachment field and a processing-queue
First, ensure Add these fields to the context:
support_tickets_context has fields for the PDF S3 key and the extracted text. Then register a processor queue:src/contexts/index.ts
2
Write the processor filter
The When
filter function is called before execute. Return the item to proceed, or return null/undefined to skip.A good filter skips items that have no attachment and items whose attachment has not changed since the last processing run:filter returns null, the item is not processed. However, if generateEmbeddings: true is set, IMP still triggers embedding generation for that item — so existing embeddings remain up to date even when the processor is skipped.3
Write the processor execute function
execute receives the item and utils.storage. Download the PDF via a presigned URL, extract its text, and return the enriched item:execute is persisted back to the items table with last_processed_at updated. Always spread ...item so you do not lose fields the processor did not touch.4
Attach the processor to the context
src/contexts/index.ts — supportTicketsContext
generateEmbeddings: true and configuration.calculateVectors: "manual", the flow for a new ticket with an attachment is:execute (via the filter) but still get embedding triggered (because generateEmbeddings: true applies even when the filter skips). This means embeddings are always generated from whatever content is on the item, whether or not a PDF was processed.5
Test the processor
Add an item with a PDF attachment through the IMP UI (open the context, click New item, and upload a
.pdf file to the attachment field). The processor will run on insert.To monitor progress, go to Build → Knowledge → support_tickets_context → Pipeline → Processor → Jobs. You will see the item’s job in the queue, its status, and any errors.To trigger the processor in bulk on existing items that have not been processed yet:- Go to Pipeline → Processor.
- Click Trigger to open the bulk-processing dialog.
- Filter to items with no
extracted_textvalue and confirm.
What you built
- A processor queue sized for PDF processing (2 workers, 20-minute timeout).
- A
filterthat skips items with no attachment and items whose content has not changed. - A
executefunction that fetches a PDF via presigned URL, extracts text, and returns the enriched item. generateEmbeddings: trueso embeddings run automatically after processing completes.
Next steps
Queues and workers
Register embedder and processor queues sized to your rate limits.
ExuluContext — configuration
Processor configuration reference — trigger values, queue, timeoutInSeconds.
ExuluStorage
getPresignedUrl and uploadFile signatures.