I was eager to test the new flow orchestrator and found a use case to try. When a user submits a case to be provisioned as a partner user, we need to process two manager approvals and then provision the contact and the user under the partner account. I built an orchestration to complete the approvals and then provision the user
I used the tutorials provided here by Alex to build this. The overall design uses three flows that share data using input and output variables.
My starting conditions were based on case creation
The manager approval is routed to the approving manager lookup field from the case
The supervisor approval is routed to a specified username
My approval flow is very simple and includes just one screen. It outputs the approval, and some user data from the case, that will be consumed by the provisioning flow. I used some interesting formulas to parse the supplied Web Name from the case to a first name and a last name, and since only variables can be designated for output, I’m assigning my formulas as the default value of the output variable
Here is how the approval request screen looks to the approving manager
Next, I created an autolaunched flow that evaluates both approvals and outputs the special “isOrchestrationConditionMet” boolean value that tells the next step to start. This flow also updated the final approval status on the case record.
Then my provisioning flow will start and show as a work item to the case owner
Here is how the provisioning screen looks to the user. The first name, last name, email, and account name, are populated from the approval flow and case record data.
In this screen I’m using the Quick Lookup flow screen component to dynamically filter the user role list based on the selected partner account
And after the provisioning is complete, the flow shows the success scree
I used some special formulas to set the alias, email, nickname, and username for the new user. To avoid a mixed DML error, I used the Commit Transaction action between creating the contact and creating the user.
When the orchestration completed, I was able to view all the completed stages, and steps in the flow orchestration instance history
Overall, building this orchestration was fun and easy. I can see how powerful this tool can be for handling complex processes. I would like to be able send an approval request to non Salesforce users, that can approve by replying to the email, or by going to the work item component publicly exposed on a community page. I’m looking forward to seeing how this tool will evolve and to all the enhancements that will be made.