document/get FormID 20305
Retrieve a single document by its _id. Returns the full document body plus version metadata. Routes to the error port if the document does not exist.
When to Use
- Exact ID lookup: You already know the document ID and need the full record — for example, after a webhook delivers an order ID, retrieve the full order document to pass to downstream nodes.
- Cache miss recovery: A fast cache lookup failed; fall back to Elasticsearch to retrieve the authoritative copy by known ID.
- Existence check: Route the workflow based on whether the document exists — use the success/error port split to branch.
- Version check: Read the current
_versionbefore applying an optimistic-concurrency update.
Configuration
Connection
| Field | Required | Description |
|---|---|---|
Host | Required | Elasticsearch cluster URL, e.g. https://localhost:9200. |
Username | Optional | Elasticsearch username (required if security is enabled). |
Password | Optional | Password for the specified username. |
IgnoreSSL | Optional | Default false. Skip TLS validation. Development use only. |
Operation
| Field | Required | Description |
|---|---|---|
IndexName | Required | The index containing the document. |
DocumentId | Required | The exact _id of the document to retrieve. Supports BizFirst expressions, e.g. {{ $json.orderId }}. |
Validation Errors
| Error Code | Cause |
|---|---|
VAL_MISSING_INDEX | IndexName is empty. |
VAL_MISSING_DOC_ID | DocumentId is empty. |
Output
Success Port
Returns the Elasticsearch get response object via ElasticsearchOperationResult.Data:
| Field | Type | Description |
|---|---|---|
_id | string | The document ID. |
_index | string | The index the document belongs to. |
_version | integer | Current version of the document. Increments on each update. |
_source | object | The full document body — all indexed fields and their current values. |
found | boolean | true when the document exists. A false value routes to the error port. |
Error Port
Fires when the document does not exist (404), authentication fails, or a network error occurs. The error output contains errorCode and message fields.
{{ $output.nodeName._source.fieldName }}. For example, if the node is called getOrder, use {{ $output.getOrder._source.status }} to read the order status.
Example
Retrieve an Order by ID
{
"resource": "document",
"operation": "get",
"IndexName": "orders",
"DocumentId": "{{ $json.orderId }}"
}
On the success port, access fields with {{ $output.getOrder._source.customerEmail }}. On the error port, handle the not-found case — for example, send a "order not found" response or trigger a fallback database lookup.
Existence Check — Branch Pattern
{
"resource": "document",
"operation": "get",
"IndexName": "product-cache",
"DocumentId": "{{ $json.productId }}"
}
Connect the success port to a "cache hit" branch and the error port to a "cache miss" branch that calls the source API and then indexes the result with document/create.