Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 66 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,18 +55,80 @@ Follow the [installation guide](https://docs.n8n.io/integrations/community-nodes
- **Parameters:**
- Message: `What is the latest update on project X?`
- Agent: (Select from dropdown)
- Additional Fields (optional): Username, Email, Timezone
- Additional Fields (optional): Username, Email, Full Name, Timezone, Wait For Completion, Poll Interval (Ms), Max Wait (Ms), Include Generated File Content, Max Generated File Size (Bytes)

**Output:**

```
{
"agentMessage": "Project X is on track for delivery next week.",
"chainOfThought": "Looking up the project in Jira, then cross-referencing with the latest standup notes...",
"conversationId": "ivxVYkiwhA",
"conversationTitle": "Project X delivery update",
"conversationUrl": "https://dust.tt/w/{workspaceId}/assistant/{conversationId}",
"generatedFiles": [
{
"fileId": "fil_4aO6lmikIV63Bi",
"title": "jirateam_1780301864867_1.txt",
"contentType": "text/plain",
"snippet": "Found 70 issue(s)...",
"downloadUrl": "https://dust.tt/api/w/{workspaceId}/files/fil_4aO6lmikIV63Bi?action=download",
"fromToolName": "get_issues_using_jql",
"fromActionSId": "act_se8GjPQjCZzVwY",
"size": 161234,
"responseContentType": "text/plain; charset=utf-8",
"content": "Found 70 issue(s) using JQL\n\n# DATA-10998..."
}
],
"rawConversation": { /* full conversation object including actions, citations, generated files */ },
"userMessage": { ... }
}
```

| Field | Description |
|---|---|
| `agentMessage` | Final answer text from the agent (markdown). |
| `chainOfThought` | Reasoning trace if the agent's model supports it (Sonnet/Opus thinking models). `null` otherwise. |
| `conversationId` | Dust `sId` of the conversation. Use it to send follow-up messages or to open the conversation in the Dust UI. |
| `conversationTitle` | Title auto-generated by Dust once the agent finishes. `null` if not set. |
| `conversationUrl` | Direct link to the conversation in the Dust UI. |
| `generatedFiles` | Array of files the agent generated during the run (e.g. CSV/text/HTML attachments produced by tool calls). Always populated with metadata; the actual content is inlined when **Include Generated File Content** is on. Empty array if the agent produced none. |
| `rawConversation` | The full conversation object (`content`, `actions`, `citations`, `generatedFiles`, …). Useful to extract tool outputs, file IDs, or per-action details downstream. Can be large for agents that make many tool calls. |
| `userMessage` | The first user message in the conversation, including the resolved user object. |

#### Generated files

When the agent produces files during its run (Jira extracts, CSV exports, HTML visualizations, …), they show up in the `generatedFiles` array. Each entry contains:

| Sub-field | Description |
|---|---|
| `fileId` | Dust file ID (`fil_…`). |
| `title` | Display name of the file (e.g. `report.csv`). |
| `contentType` | Content-Type reported by Dust at generation time. |
| `snippet` | Short preview Dust attaches to the file metadata. |
| `downloadUrl` | Full HTTPS URL to `GET` the raw content (uses the same Dust API key for auth). |
| `fromToolName` / `fromActionSId` | Which tool call produced the file. `null` when the file is attached to the agent message itself. |
| `size` | Byte length of the downloaded content (only present when downloaded). |
| `responseContentType` | Content-Type returned by the download endpoint (only present when downloaded). |
| `content` | UTF-8 string content for textual files (HTML, CSV, JSON, Markdown, YAML, plain text, …). Only present when **Include Generated File Content** is on. |
| `contentBase64` | Base64-encoded content for binary files (images, PDFs, …). Only present when **Include Generated File Content** is on. |
| `tooLarge` | `true` if the file exceeded **Max Generated File Size (Bytes)** — content is omitted to keep the workflow output sane. |
| `downloadError` | Error message if the download itself failed. The rest of the workflow continues. |

#### Long-running agents & polling

The node creates a conversation and then **polls** the Dust API until the agent finishes, before returning the final `agentMessage`. This matches the pattern used by Dust's own clients and avoids `502 Bad Gateway` errors that previously occurred for agents that take more than ~30 seconds (e.g. agents that call out to Jira, Slack, Google Docs, or other slow tools).

You can tune the polling behavior via Additional Fields:

| Field | Default | What it does |
|---|---|---|
| `Wait For Completion` | `true` | If off, the node returns immediately with just `{ conversationId, conversationUrl, userMessage }`. Use this when you want to manage polling yourself (e.g. with an HTTP Request + Wait loop). |
| `Poll Interval (Ms)` | `1500` | Time between polling attempts while the agent is running. |
| `Max Wait (Ms)` | `120000` | Hard ceiling on the total wait. If the agent has not reached `succeeded` by then, the node throws. |

If the agent ends in `failed` or `cancelled`, the node throws with the error message from Dust. The conversation URL is included in the error so you can inspect it in the Dust UI.

### Upload a Document

- **Operation:** Upload a Document
Expand Down Expand Up @@ -103,6 +165,9 @@ Add these credentials in n8n under the "Dust API" credential type and reference

## Version history

- Unreleased
- Fix `502 Bad Gateway` for long-running agents by switching from blocking POST to non-blocking POST + polling on `GET /conversations/{id}`. Adds `Wait For Completion`, `Poll Interval (Ms)`, `Max Wait (Ms)`, and `Full Name` fields. Output now also includes `conversationId`, `chainOfThought`, `conversationTitle`, and `rawConversation`.
- Surface files the agent generates during the run as a top-level `generatedFiles` array. Adds `Include Generated File Content` (default on) and `Max Generated File Size (Bytes)` (default 10 MB) fields; textual files come back as inlined `content`, binary files as `contentBase64`.
- 0.1.1
- Add SkipToolsValidation + rename assitant to agent
- 0.1.0
Expand Down
Loading