Mongo Update Objects Step

Use this step to update the JSOB object in the Mongo DB.

Last published at: April 16th, 2026

clsMongoUpdateObjects Step

Description:

The Update JSON Objects in MongoDB step enables a FlowWright workflow to locate one or more MongoDB documents using a JSON filter and apply an update operation to all matching documents.

This step is commonly used in workflows that need to modify business information stored in MongoDB without replacing entire documents. By separating the document selection criteria from the update definition, the step provides a flexible mechanism for performing targeted updates while preserving the remaining document structure.

The step connects to a configured MongoDB database, accesses the specified collection, identifies documents that satisfy the supplied JSON filter, and applies the specified JSON update operation.

Typical update scenarios include:

  • Updating customer status
  • Modifying workflow state
  • Recording approval results
  • Updating inventory availability
  • Maintaining configuration values
  • Logging processing timestamps
  • Synchronizing external application data

The update operation follows MongoDB JSON update syntax, allowing workflows to modify only the required document fields.

 

Inputs

  • Select MongoDB Connection String – Selects the configured MongoDB connection used to access the database.
  • Enter Database Name - Specifies the MongoDB database containing the collection to update.
  • Enter Collection Name - Specifies the MongoDB collection containing the documents to update.
  • Enter JSON Filter to Match Objects for Update - Defines the MongoDB JSON filter used to identify the documents that should be updated.
  • Enter JSON Data for the Update Operation - Specifies the MongoDB JSON update expression that will be applied to all matching documents. 
 

 

Returns

  • True – The MongoDB update operation completed successfully.
  • False - The update operation failed because of a connection problem, invalid configuration, invalid JSON syntax, missing collection, or another execution error.
 

 

Usage:

The Update JSON Objects in MongoDB step is typically used after business logic determines that one or more MongoDB documents require modification.

During execution:

  1. Connect to the selected MongoDB server.
  2. Open the specified database.
  3. Access the configured collection.
  4. Apply the JSON filter to locate matching documents.
  5. Execute the JSON update operation.
  6. Follow either the True or False return path based on the execution result.

A typical workflow might look like this:

 

Typical workflow scenarios include:

  • Marking customer accounts as active
  • Updating order processing status
  • Recording document approval results
  • Maintaining inventory quantities
  • Updating workflow progress information
  • Synchronizing application data
  • Recording processing timestamps after workflow completion

 

Prerequisite:

Navigate to the Integration - Connections page. Create a new MongoDB connection string as shown below. Click the Test button to validate the connection response. 

 

Example:

Let’s build and execute the “clsMongoUpdateObjectsDef” example.          

  • Create a new process definition called “clsMongoUpdateObjectsDef” and open the definition in designer mode. 
  • Drag “clsMongoGetObjects, and clsMongoUpdateObjects” steps to the canvas. 
  • Connect the dots between the “Start” and other steps, as shown above.
  • Define a variable or a global to store JSON objects. 
  • Click the "clsMongoGetObjects" step to configure its "Required" properties. Provide a name for the step. Select the MongoDB connection string from the drop-down list. Provide the database name. Provide the collection name. Provide the variable or global reference to store the JSON object fetched during execution. Click the Save button. Note: Click the "AI Predict" button for the Copilot to add new process steps that match your process description.

 

  • Click the "clsMongoGetObjects" step to configure its "Optional" properties. Provide a JSON filter to match the object. Note: This configuration is optional; if left empty, the step will fetch all JSON objects. Click the Save button. 

 

  • Click the "clsMongoUpdateObjects" step to configure its "Required" properties. Provide a name for the step. Select the MongoDB connection string from the drop-down list. Provide the database name. Provide the collection name. Provide the JSON filter to match objects for the update. Provide the JSON data for the update operation. Click the Save button. Note: Click the "AI Predict" button for the Copilot to add new process steps that match your process description.

 

  • Click the "clsMongoGetObjects" step to configure its "Required" properties. Provide a name for the step. Select the MongoDB connection string from the drop-down list. Provide the database name. Provide the collection name. Provide the variable or global reference to store the JSON object fetched during execution. Note: Click the "AI Predict" button for the Copilot to add new process steps that match your process description.

 

  • Click the "clsMongoGetObjects" step to configure its "Optional" properties. Provide a JSON filter to match the object. Note: This configuration is optional; if left empty, the step will fetch all JSON objects. Click the Save button. 

 

  • The “Logging” configuration is necessary for documentation and also measures workflow progress and percent complete. This is achieved by configuring the step state and percent fields individually, as shown below. Configure the “Logging” using the following properties.

 

  • Save the process definition, create a new instance, and execute it. Render the process instance. Click the process step to view its variables. The “clsMongoUpdateObjects” step should update the JSON objects in MongoDB as configured.  

 

Tips:

  • Use precise JSON filters to avoid unintentionally updating additional documents.
  • Test JSON filters independently before deploying workflows to production.
  • Use MongoDB update operators such as $set, $unset, $inc, or $push where appropriate.
  • Validate JSON syntax before publishing the workflow.
  • Route the False path to logging or notification steps to simplify troubleshooting.
  • Consider retrieving documents before updating them when business validation is required.
  • Combine this step with Get a List of Objects Using a JSON Filter Condition, Loop Each, REST Call, Generate Document, Send Email, or Business Rule steps to create complete MongoDB-driven workflow solutions.

 

Notes:

  • A valid MongoDB connection must exist before this step can execute.
  • Database and collection names must correspond to existing MongoDB objects.
  • Both the JSON filter and JSON update expression are required.
  • Incorrect JSON syntax or invalid MongoDB update expressions may cause the step to follow the False return path.
  • The step updates only documents that satisfy the configured filter.
  • The True and False return paths should be used to implement appropriate workflow success and error handling.
  • Execution details, update status, and any errors are recorded in the FlowWright workflow execution log.

 

Update JSON Objects in MongoDB vs. Get a List of Objects Using a JSON Filter Condition:

Both MongoDB workflow steps interact with MongoDB collections, but they perform different operations.

Update JSON Objects in MongoDB Get a List of Objects Using a JSON Filter Condition
Modifies existing MongoDB documents. Retrieves MongoDB documents without modifying them.
Requires both a JSON filter and a JSON update expression. Requires only an optional JSON filter.
Performs write operations against MongoDB. Performs read operations against MongoDB.
Used for maintaining and synchronizing data. Used for reporting, searches, and data retrieval.

As a general guideline:

  • Use Update JSON Objects in MongoDB when workflow execution needs to modify existing MongoDB documents.
  • Use Get a List of Objects Using a JSON Filter Condition when workflow execution only needs to retrieve MongoDB documents for processing or reporting.

 

Definition Sample:

You may download the sample workflow definition from the link provided and import it into your FlowWright environment.

Note: Verify and complete any missing configuration after importing the sample, including:

  • MongoDB connection string
  • Database name
  • Collection name
  • JSON filter
  • JSON update expression
  • Success and error handling
  • Workflow branching

After verifying the configuration, save and publish the workflow before execution.

Click here to download the sample file.