$input — Node Input Directive
Reads fields from the current node's input item(s) — supports single item, first/last shortcuts, indexed access, and binary fields.
| Property | Value |
|---|---|
| Directive name | input |
| Required isolation level | Safe |
| Project | NodeData.Services |
| Data source | INodeExecutionData.CurrentItem / .InputItems |
Selectors
| Selector | Resolves to |
|---|---|
$input.current | The currently active execution item (the item this node is processing) |
$input.first | First item in the input collection |
$input.last | Last item in the input collection |
$input.items | All input items as a JSON array |
$input.current._binary.fieldName | Binary/file attachment on the current item |
Path Reference
// Input item structure (example):
{
"id": 1001,
"email": "alice@acme.com",
"firstName": "Alice",
"amount": 4500.00,
"status": "pending",
"address": {
"city": "Dublin",
"country": "IE"
},
"tags": ["vip", "enterprise"],
"_binary": {
"attachment": { "filename": "invoice.pdf", "mimeType": "application/pdf", "data": "base64..." }
}
}
// Expressions:
{@ $input.current.id } → 1001
{@ $input.current.email } → "alice@acme.com"
{@ $input.current.address.city } → "Dublin"
{@ $input.current.tags[0] } → "vip"
{@ $input.current._binary.attachment @json } → binary descriptor as JSON
{@ $input.first.id } → first item's id
{@ $input.items @json } → full array serialized
Complex Scenarios
Scenario 1 — Forward All Input Fields to External API
Send the full current item as the body of an HTTP request:
HTTP Request body
{@ $input.current @json }
Entire input item serialized as JSON request body
Scenario 2 — Build a Notification from Input + Context
Slack message
🔔 New {@ $input.current.type @uppercase } from {@ $input.current.email } — Amount: {@ $input.current.amount } {@ $ctx.tenant.currency } | Ref: {@ $input.current.referenceId @default:N/A }
🔔 New INVOICE from alice@acme.com — Amount: 4500 EUR | Ref: INV-2024-001
Scenario 3 — Conditional Processing Based on Input Field
// Switch node: route by payment method
{@ $input.current.paymentMethod @uppercase }
// → "CARD" → routes to Stripe branch
// → "BANK_TRANSFER" → routes to SEPA branch
// → "PAYPAL" → routes to PayPal branch
Scenario 4 — Batch Processing: Read from First Item for Configuration
When processing a batch, the first item contains batch metadata used by all subsequent items:
// All items in the batch share the same batchId (in first item)
{@ $input.first.batchId }
// Used in: audit log, error reporting, deduplication
{@ $input.first.tenantOverride @default:{@ $ctx.tenant.id } }
// Falls back to context tenant if first item doesn't specify an override
Scenario 5 — Binary Attachment Processing
// HTTP node: upload the attached PDF to a document store
// Body: binary data as base64
{@ $input.current._binary.attachment @base64 }
// Header: Content-Type from binary descriptor
{@ $js`return context.input.current._binary.attachment.mimeType` }
// Filename for storage path
{@ $js`return context.input.current._binary.attachment.filename` }
Scenario 6 — Array Field Extraction for Batch Insert
Input contains an array field; extract specific elements for downstream processing:
// Input: { "orderId": "ORD-001", "items": [{sku:"A",qty:2},{sku:"B",qty:5}] }
// First SKU in the items array
{@ $input.current.items[0].sku } → "A"
// Total quantity across all items (JavaScript needed for aggregation)
{@ $js`
return context.input.current.items.reduce((sum, i) => sum + i.qty, 0)
` } → 7
// Serialize the items array for API body
{@ $js`return JSON.stringify(context.input.current.items)` }
Common Errors
| Error | Cause | Fix |
|---|---|---|
PathNotFound: current.fieldName | Field doesn't exist on this item type | Use @default or check field name with trace logging |
PathNotFound: first | Empty input collection | Add an upstream guard to verify non-empty before entering the node |
| Returns wrong item | Using current outside of a loop (no active item) | Use first when the node processes one batch, not per-item |