Skip to main content
A processor runs after items are written to the context — it transforms raw data into a form the embedder can work with. This tutorial adds a processor to support_tickets_context that fetches PDF attachments from S3, extracts their text into a structured field, and then triggers embedding generation automatically.

Prerequisites

When processors run

A processor runs after an item is written to the context. The trigger 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 support_tickets_context has fields for the PDF S3 key and the extracted text. Then register a processor queue:
src/contexts/index.ts
Add these fields to the context:
2

Write the processor filter

The 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:
When 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:
The object returned from 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
With generateEmbeddings: true and configuration.calculateVectors: "manual", the flow for a new ticket with an attachment is:
Items without attachments skip 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:
  1. Go to Pipeline → Processor.
  2. Click Trigger to open the bulk-processing dialog.
  3. Filter to items with no extracted_text value and confirm.

What you built

  • A processor queue sized for PDF processing (2 workers, 20-minute timeout).
  • A filter that skips items with no attachment and items whose content has not changed.
  • A execute function that fetches a PDF via presigned URL, extracts text, and returns the enriched item.
  • generateEmbeddings: true so 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.