Use Documents in Chats & Workflows
Once you have a Document Source (and its documents have been processed), you can use it to ground chats and workflow runs.
Chats
Chat requests can reference a source via sourceId (the document source code). This tells the system which document collection to use as context.
Minimal example:
curl -X POST "https://app.noema.ai/api/chat/assistant/$ASSISTANT_ID" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"sourceId": "my-source",
"messages": [
{"role": "user", "content": "Summarize our handbook."}
]
}'
Where to look:
- API reference:
/api/chat/assistant/{assistant_id} - The request body includes
sourceId.
Workflows
Workflow runs support attaching files directly.
Endpoint: POST /api/workflow/run
- Request format is
multipart/form-data - Attach files using the
filesfield
When you attach files to a workflow run, the backend uploads them to a file-backed source for that run and triggers ingestion so they become available during execution.
Practical notes:
filescan contain one or many uploaded files.- The platform creates a hidden, file-backed source (container keyed by the workflow run id) and ingests the uploaded documents.
- During the run, the workflow can reference those ingested documents by name/parameter depending on the workflow’s inputs.
Recommended flow
- Create a Document Source (for persistent knowledge): Document Sources
- Upload documents: Upload & Manage Documents
- Process/index documents: Ingestion & Processing
- Reference the source from chats/workflows via
sourceId