Automate Oneflow Document Updates with a Salesforce Flow Invocable Action

Dineth Kurukularatchi
Dineth Kurukularatchi
  • Updated

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.

TermWhat it means
Draft/Pending documentA 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 documentA document where all parties have signed. The sync will not update these to prevent invalidating signatures.
Partially signedOne 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 ActionA 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 JobBehind 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 fieldRequired?Description
Object Record IdRequiredThe 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 DocumentsOptional (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 fieldDescription
recordIdThe ID of the Salesforce record that was processed.
contractsProcessedNumber of documents successfully queued for update.
contractsSkippedNumber of documents that were skipped (signed, partially signed, or missing a Oneflow ID).
skipReasonsSummaryA text summary of why each document was skipped. Useful for debugging or logging in your Flow.
statusOverall 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 conditionReason
Document is fully signedUpdating a fully signed document would invalidate legal signatures. The action will never update these.
Document is partially signed and the optional flag is not enabledThe 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

  1. Log in to Salesforce and navigate to Setup.
  2. In the Quick Find box, search for Flows and click Flows.
  3. Click New Flow.
  4. Select Scheduled-Triggered Flow (for nightly runs) or choose another trigger type as needed.

Step 2: Configure the schedule (for Scheduled Flows)

  1. Set the Start Date and Time (for example, every night at 2:00 AM).
  2. Set the Frequency to Daily (or as required).
  3. 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.

  1. Click the + icon on the canvas to add an element.
  2. Select Loop.
  3. Set the Collection Variable to your collection of records (for example, {!Get_Opportunities}).
  4. Click Done.

Step 4: Add the action element

  1. Inside your Loop (or directly on the canvas for single records), click the + icon and select Action.
  2. In the search box, type Update Oneflow Documents.
  3. Select the action from the list.

Step 5: Configure the input values

  1. 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).
  2. 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.
  3. 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.

  1. In the action element, scroll to Store Output Values.
  2. Map each output field (for example, status, contractsSkipped) to Flow variables for later use.
  3. Add a Decision element after the action to branch on status = None or status = Partial if you want to trigger notifications for skipped documents.

Step 7: Activate the Flow

  1. Click Save and give your Flow a descriptive name (for example, Nightly Oneflow Document Sync).
  2. 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 typeWhat is updated
Data field valuesAll custom field mappings you have configured between your Salesforce object and the Oneflow document template (for example, Opportunity Amount, Close Date, Account Name).
Participants & partiesContact and signatory information linked to the document is refreshed to reflect any changes in Salesforce.
Products / line itemsOpportunity products or line items are updated in the Oneflow document product table.
Document valueThe 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

SymptomLikely cause & resolution
status = None for all recordsAll documents were skipped. Check skipReasonsSummary in the Flow output. Most common causes: documents are already signed, or missing a Oneflow Document ID.
status = PartialSome documents were updated and some were skipped. Review skipReasonsSummary for which documents were skipped and why.
Action not appearing in Flow BuilderEnsure 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 permissionsThe 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 OneflowVerify 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 flagConfirm that the Update Partially Signed Documents input is set to True (Boolean) in your Flow, not the text string 'true'.

Was this article helpful?

0 out of 0 found this helpful

Have more questions? Submit a request