Portal Community

Output Ports

The MongoDB node exposes two output ports. On a successful database operation the success port fires carrying the operation result. On any connection failure, authentication error, or MongoDB server error the error port fires instead.

success

Fires when the MongoDB operation completes without error. The output data is available in downstream nodes via $node.<NodeName>.output. The shape of the data varies by operation — see the per-operation sections below.

error

Fires when the operation fails. Connect to a Catch Block, a notification node, or a Stop Workflow node. The error payload is available as $node.<NodeName>.error.

Error Output Fields

FieldTypeDescription
error.messagestringHuman-readable error description. Includes MongoDB server error messages for query failures, authentication errors, and network timeouts.
error.codeintegerMongoDB error code (e.g. 11000 for duplicate key, 13 for unauthorised, 26 for namespace not found).
error.codeNamestringMongoDB error code name string (e.g. "DuplicateKey", "Unauthorized").
error.operationstringThe operation that failed (e.g. "find", "insert", "aggregate").

find — Output Data

FieldTypeDescription
output.documentsarrayArray of documents matching the filter. Each element is the full document object (or projected fields if projection was configured). Empty array if no documents match.
output.countintegerNumber of documents returned in this query (after limit is applied). Use count to check if any results were found before processing the documents array.
// Example: $node.GetPendingOrders.output after find
{
  "documents": [
    {
      "order_id": "ORD-20260523-001",
      "customer_id": "CUST-7744",
      "status": "pending",
      "total_amount": 149.95,
      "created_at": "2026-05-23T08:00:00Z"
    },
    {
      "order_id": "ORD-20260523-002",
      "customer_id": "CUST-8821",
      "status": "processing",
      "total_amount": 299.00,
      "created_at": "2026-05-23T08:15:00Z"
    }
  ],
  "count": 2
}

insert — Output Data

FieldTypeDescription
output.inserted_idstringThe _id of the inserted document (single insert). MongoDB-generated ObjectId as a string, unless you supplied a custom _id.
output.inserted_idsarrayArray of _id values for bulk insert operations. Index position corresponds to the order of the input documents array.
output.inserted_countintegerNumber of documents successfully inserted.
// Example: $node.CreateAuditEntry.output after insert (single document)
{
  "inserted_id": "6650f4a2c3e1b2d9f80a1234",
  "inserted_count": 1
}

// Example: $node.BulkImportProducts.output after insert (documents array)
{
  "inserted_ids": [
    "6650f4a2c3e1b2d9f80a0001",
    "6650f4a2c3e1b2d9f80a0002",
    "6650f4a2c3e1b2d9f80a0003"
  ],
  "inserted_count": 3
}

update — Output Data

FieldTypeDescription
output.matched_countintegerNumber of documents that matched the filter.
output.modified_countintegerNumber of documents actually modified. May be less than matched_count if some documents already had the update values.
output.upserted_idstring | nullThe _id of the document inserted when upsert is true and no document matched. null when an existing document was updated.

delete — Output Data

FieldTypeDescription
output.deleted_countintegerNumber of documents that were deleted. Use this in downstream condition nodes to verify deletion success.

find-one-and-update / find-one-and-replace — Output Data

FieldTypeDescription
output.documentobject | nullThe found document — either before or after the operation depending on return_document configuration. Returns null if no document matched and upsert is false.
output.foundbooleanConvenience field — true when a document was found and returned, false when null was returned. Use in downstream If Condition nodes.

aggregate — Output Data

FieldTypeDescription
output.resultsarrayArray of documents produced by the aggregation pipeline. Each element corresponds to one output document from the final pipeline stage.
output.countintegerNumber of result documents in the array.
// Example: $node.DailySalesAgg.output after aggregate
{
  "results": [
    { "category": "Electronics", "total_revenue": 45200.00, "order_count": 88, "avg_order_value": 513.63 },
    { "category": "Clothing",    "total_revenue": 18750.50, "order_count": 215, "avg_order_value": 87.21 },
    { "category": "Books",       "total_revenue": 3920.00,  "order_count": 196, "avg_order_value": 20.00 }
  ],
  "count": 3
}

Search Index Operations — Output Data

FieldTypeDescription
output.indexesarray(list only) Array of index descriptor objects, each with name, status (READY/BUILDING), and definition fields.
output.index_namestring(create, update, drop) Name of the index that was acted upon.
output.statusstring(create, update) Current build status of the index: BUILDING (index rebuild in progress) or READY.
Referencing Output in Downstream Nodes: Use $node.<NodeName>.output.documents to pass a result set into a Loop node, or $node.<NodeName>.output.count in an If Condition to branch on whether results were found. For find-one-and-update, use $node.<NodeName>.output.document.field_name to access individual fields of the returned document.
Duplicate Key Errors: If you insert a document with a duplicate value on a unique-indexed field, the error port fires with error.code: 11000. Handle this explicitly with a Catch Block if upsert behaviour is not suitable — for example, to merge records rather than reject them.