Skip to main content

#Flows10 discussing

Subject: No supported API (Apex/REST) to programmatically approve/reject Flow Orchestration Approval Work Items

I am looking for a supported way to programmatically approve or reject a Flow-based Approval Process (Flow Orchestration) approval request using a non-interactive integration/API user, similar to Approval.process() for Classic Approval Processes.

We've tested the following approaches:

  1. Approval.process() / Approval.ProcessWorkitemRequest (Apex)
    • Only works with Classic Approval objects (ProcessInstance, ProcessInstanceWorkitem).
    • No support for the newer ApprovalWorkItem / ApprovalSubmission objects.
  2. Direct DML update on ApprovalWorkItem.Status

ApprovalWorkItem wi = [

SELECT Id, Status

FROM ApprovalWorkItem

WHERE Id = :workItemId

];

wi.Status = 'Approved';

update wi;

Result:

System.DmlException: Update failed.

First exception on row 0 with id [id];

first error: INSUFFICIENT_ACCESS_OR_READONLY,

User cannot edit Approval Work Item Standard Fields: []

This was reproduced on multiple ApprovalWorkItem records across different Flow Approval processes using Execute Anonymous as a System Administrator. Since Apex runs in system context, this doesn't appear to be a standard permissions or field-level security issue.

Question: Is there any supported Apex API, REST API, or other documented mechanism to programmatically approve/reject Flow Orchestration Approval Work Items

, or is this functionality currently unsupported? 

 

#Flows

0/9000

Hello,  

 

I'm drawing a blank on how record variables from outputs and assignment elements work together with update elements. Maybe someone can remind me what I'm missing here.  

 

I have an opportunity trigger flow which runs broadly for opportunity creation and updates. The flow has branches for subflows which contain the processes of updating the opportunity and it's related record information.  

 

I send in the triggering opportunity to one of those subflows and return a new output variable from that subflow. Then later in this trigger flow I want to make additional updates to that same output variable. Those updates are made in an assignment element directly into the output variable. This output variable is then used in a update records element. When I look at the updates which are going in in the debug mode, the values set in the previous assignment are not set.  

 

Condensed version of the steps the flow takes. 

1. Opportunity updated.  

2. Get opportunity account. 

3. Decision: Update account ARR. 

4. Trigger subflow: Send in the triggering opportunity's account from step 2.  

5. Subflow logic runs and uses the input account and builds out the updates to a new variable accOut.  

6. Subflow finishes, accOut is now available as an output.  

7. Decision: Update account service term dates.  

8. Assign service term dates to accOut variable.  

9. Update records: sending the accOut variable into the update.  

 

Snippets from flow debug: 

Assignment: Assign Quote To Account Values

5 variables were updated.

Result

...

{!SubflowUpdateARRBasedOnSubscriptions.varRecAccountInOut.Service_Term_End_Date__c} = "22. July 2027"

{!SubflowUpdateARRBasedOnSubscriptions.varRecAccountInOut.Service_Term_Start_Date__c} = "23. July 2026" 

...

 

Update Records: Update Opportunity Account

Update Account records whose IDs are stored in {!SubflowUpdateARRBasedOnSubscriptions.varRecAccountInOut}.

  "Service_Term_End_Date__c": null, 

  "Service_Term_Start_Date__c": null, 

 

#Flows  #Salesforce Flow

1 answer
0/9000

I am facing an issue with sending an email from a Screen Flow using an existing custom email template. The email should be triggered when a Decision condition evaluates to true. However, when configuring the Send Email action with the email template, Salesforce requires a Recipient ID.

My solution is based on the Case and Task objects only, and I am unsure what value should be provided for the Recipient ID field in this scenario. Could you please advise on the appropriate Recipient ID to use when the email template is related to the Case object?

 

Note : Flow type is Screen Flow 

 

#Salesforce Developer  #Flows  #Salesforce Admin

2 answers
  1. Jul 9, 2:03 PM

    Hi, the "Recipient Id" can be the ID of either a User, a Contact or a Lead. You may pull this Id from case or task object field or using the Get Records element as well. 

0/9000

Review the errors on this page.

  • We can't save this record because the “Translate Fitness Survey Input Flow” process failed. Give your Salesforce admin these details. Missing required input parameter: Input:Account Missing required input parameter: Input:Contact Missing required input parameter: Input:Fitness Error ID: 1508558276-625752 (-1067448536)

 

Unable to set Input Values, Set through variables then below error

 

 

image.png

 

 

 

#Trailhead Superbadges  #Flows  #Salesforce  #Salesforce Admin

1 answer
  1. Jul 3, 2:17 PM

    Probably the GET RECORD elements of Contact and Fitness are not returning anything. Put a decision element to check if they are returning something then only proceed further otherwise show an error.

0/9000

🚀 New Salesforce Feature Explained: Flow Embedded Analytics

 

Understanding how your Salesforce Flows behave in real time just got easier!

In my latest video on Technical Potpourri, I explore Salesforce’s new Flow Embedded Analytics feature, which brings powerful visibility directly into the Flow Canvas.

 

🔍 What’s covered in the video?

• Total flow runs displayed on each flow element

• Clear insights into execution paths and performance

• How this helps admins and developers debug and optimize flows faster

 

If you work with Salesforce Flows, this feature is a game-changer for performance analysis and troubleshooting.

 

🎥 Watch the full video here:

👉 https://youtu.be/FdfXfq6JTqo

 

 

🚀 New Salesforce Feature Explained: Flow Embedded Analytics Understanding how your Salesforce Flows behave in real time just got easier!In my latest video on Technical Potpourri, I explore Salesforce

 

@The Blog Group @* Release Readiness Trailblazers *

 

 

#Flow  #Flows  #Screen Flow  #New Releases  #Release Readiness

1 comment
0/9000

I am doing the Superbadge: Advanced Flow for Agentforce

: MOdule 3 

 

Getting error "We can't find a Get Records element called Get This Contact's Orders in the Refund Request flow, or it isn't configured as specified. Make sure the filter condition is setting the CustomerAuthorizedById, not CompanyAuthorizedById." 

 

I've checked all the elements in my flow, which are correct. The conditions are correct, sort is descending by create date, limit 5 records.  I've deleted and recreated the decision element several times and still not had any luck passing this part of the training. I've debugged the flow and it works as well. 

 

Any help please recommend. (attached screenshots) 

 

 

 

#Agentforce  #Flows

0/9000