1. Overview
The Update Oneflow Documents invocable action lets Salesforce administrators automate the process of keeping Oneflow documents in sync with Salesforce data, without requiring any manual work.
Once configured in a Salesforce Flow (scheduled or event-based), the action will automatically push the latest Salesforce values into the associated Oneflow documents every time it runs.
What does it do?
- Reads the Salesforce record you specify (for example, an Opportunity, Account, or Custom Object).
- Finds all linked Oneflow documents for that record.
- Pushes updated field values (data fields, participants, products, document value) to Oneflow.
- Skips fully signed documents and, by default, partially signed documents to protect existing signatures.
- Returns a structured result so you can check what was updated and what was skipped.
2. Key concepts before you start
Before setting up your Flow, it helps to understand the following terms and rules that govern how the action behaves.
| Term | What it means |
|---|---|
| Draft/Pending document | A document in Oneflow that has been created (Draft) and may have been sent to participants (Pending), but has not yet been fully signed. The sync will update these. |
| Signed document | A document where all parties have signed. The sync will not update these to prevent invalidating signatures. |
| Partially signed | One or more (but not all) parties have signed. By default the sync skips these. You can optionally allow updates, but doing so will reset existing signatures. |
| Invocable Action | A reusable piece of logic you can call from any Salesforce Flow. You do not need to write any code; configure it in Flow Builder. |
| Queueable Job | Behind the scenes, each document sync runs as an asynchronous background job. This allows large batches to be processed safely within Salesforce governor limits. |
3. Input & output reference
3.1 What you pass in (inputs)
| Input field | Required? | Description |
|---|---|---|
| Object Record Id | Required | The Salesforce record ID of the record whose linked documents should be synced. This can be an Opportunity, Account, or any other supported object. |
| Update Partially Signed Documents | Optional (default: No) | If set to Yes, documents where some (but not all) parties have signed will also be updated. Warning: this resets all existing signatures on those documents and signers will need to sign again. |
WARNING Enabling updates for partially signed documents will reset existing signatures on those documents. Make sure this aligns with your legal and business requirements before turning it on. |
3.2 What you get back (outputs)
| Output field | Description |
|---|---|
| recordId | The ID of the Salesforce record that was processed. |
| contractsProcessed | Number of documents successfully queued for update. |
| contractsSkipped | Number of documents that were skipped (signed, partially signed, or missing a Oneflow ID). |
| skipReasonsSummary | A text summary of why each document was skipped. Useful for debugging or logging in your Flow. |
| status | Overall result: Success (all processed), Partial (some skipped), or None (all skipped). |
4. When documents are skipped
The action automatically protects certain documents from being overwritten. Below are the conditions that cause a document to be skipped:
| Skip condition | Reason |
|---|---|
| Document is fully signed | Updating a fully signed document would invalidate legal signatures. The action will never update these. |
| Document is partially signed and the optional flag is not enabled | The same risk applies: resetting signatures mid-process can cause confusion for signers. |
NOTE In all skip cases, the reason is captured in the skipReasonsSummary output so you can use it in a Flow notification, log, or decision branch. |
5. How to add this action to a Flow
The following steps walk you through adding the Update Oneflow Documents action to a Scheduled Flow. The same steps apply to any other Flow type.
Step 1: Open Flow Builder
- Log in to Salesforce and navigate to Setup.
- In the Quick Find box, search for Flows and click Flows.
- Click New Flow.
- Select Scheduled-Triggered Flow (for nightly runs) or choose another trigger type as needed.
Step 2: Configure the schedule (for Scheduled Flows)
- Set the Start Date and Time (for example, every night at 2:00 AM).
- Set the Frequency to Daily (or as required).
- Under Run Flow For, select a collection of records; for example, all Opportunities updated in the last 24 hours.
Step 3: Add a loop (for collections)
If your Flow processes a collection of records (recommended for bulk use), add a Loop element to iterate over each record individually before calling the action.
- Click the + icon on the canvas to add an element.
- Select Loop.
- Set the Collection Variable to your collection of records (for example,
{!Get_Opportunities}). - Click Done.
Step 4: Add the action element
- Inside your Loop (or directly on the canvas for single records), click the + icon and select Action.
- In the search box, type Update Oneflow Documents.
- Select the action from the list.
Step 5: Configure the input values
- For Object Record Id, click the field and select the record ID variable from your Flow (for example,
{!loopVariable.Id}if inside a loop, or{!$Record.Id}for a record-triggered flow). - For Update Partially Signed Documents, leave unchecked (false) for standard use. Enable only if you have a specific business reason to update partially signed documents.
- Click Done.
WARNING Only enable Update Partially Signed Documents if you are fully aware that all existing signatures on those documents will be reset and signers will need to sign again. |
Step 6: (Optional) Use the output
You can store the action output in a Flow variable and use it in decision branches, notification emails, or log records.
- In the action element, scroll to Store Output Values.
- Map each output field (for example, status, contractsSkipped) to Flow variables for later use.
- Add a Decision element after the action to branch on
status = Noneorstatus = Partialif you want to trigger notifications for skipped documents.
Step 7: Activate the Flow
- Click Save and give your Flow a descriptive name (for example, Nightly Oneflow Document Sync).
- Click Activate.
6. What data gets synced
When the action runs for an eligible document, it pushes the following data from Salesforce to Oneflow:
| Data type | What is updated |
|---|---|
| Data field values | All custom field mappings you have configured between your Salesforce object and the Oneflow document template (for example, Opportunity Amount, Close Date, Account Name). |
| Participants & parties | Contact and signatory information linked to the document is refreshed to reflect any changes in Salesforce. |
| Products / line items | Opportunity products or line items are updated in the Oneflow document product table. |
| Document value | The overall document value is recalculated and updated in Oneflow based on the Salesforce source record. |
NOTE Each document update runs as a separate background (Queueable) job, so it does not block or slow down any foreground Salesforce activity. The specific fields that are synced depend on the field mappings configured in your Oneflow for Salesforce installation. Contact your Oneflow administrator if you are unsure which fields are mapped. |
7. Troubleshooting
| Symptom | Likely cause & resolution |
|---|---|
| status = None for all records | All documents were skipped. Check skipReasonsSummary in the Flow output. Most common causes: documents are already signed, or missing a Oneflow Document ID. |
| status = Partial | Some documents were updated and some were skipped. Review skipReasonsSummary for which documents were skipped and why. |
| Action not appearing in Flow Builder | Ensure the Oneflow for Salesforce managed package is installed and that your user profile has access to the Apex class DocumentListInvocable. |
| Permission error at runtime / API error related to permissions | The running user or the Flow's running user must have Read access to Oneflow Document and Participant records. Check object and field-level permissions. The user who is running the Flow (or being used as the Flow’s running user) must also have access to the relevant Oneflow workspace and the document template used by the related Oneflow documents. |
| Data not updating in Oneflow | Verify that the field mappings between Salesforce and Oneflow are correctly configured in the Oneflow app settings. The sync can only push fields that have an active mapping. |
| Partially signed documents still not updating after enabling the flag | Confirm that the Update Partially Signed Documents input is set to True (Boolean) in your Flow, not the text string 'true'. |