Build the Orchestration
Learning Objectives
After completing this unit, you’ll be able to:
- Build a simple orchestration using Flow Orchestration.
- Assign flows to a step.
- Assemble steps to create a stage.
Follow Along with Trail Together
Want to follow along with an expert as you work through this step? Take a look at this video, part of the Trail Together series.
(This clip starts at the 41:56 minute mark, in case you want to rewind and watch the beginning of the step again.)
Let’s Build the Orchestration
All our flows are built. We’ve identified our steps and stages. Now it’s time to put our orchestration together!
To create this orchestration:
- From Setup, enter
Flows
in the Quick Find box, then select Flows.
- Click New Flow.
- Make sure Start from Scratch is selected, and click Next.
- Select Record-Triggered Orchestration.
We chose this option because we want the orchestration to start when the position record is created.
- Click Create.
From the canvas, you will automatically be in edit mode for the Start element. You will see the options on the right side. If not, click Edit on the Start element.
- For Object, select Position.
- For Trigger the Orchestration When, select A record is created.
- For Condition Requirements, select All Conditions Are Met (AND).
- For Field, select Status__c.
- For Operator, select Equals.
- For Value, select New.
- Click Save.
- For Orchestration Label, enter Recruiting Orchestration - Exercise.
- For Description, enter
Candidate recruiting process from initial screening to offer of employment.
- Click Save.
Add a Stage
Next, we add our first stage, Recruiter Screening.
- On the path after the Start element, click .
- Click Stage.
- For Label, enter
Recruiter Screening
.
The API Name is automatically updated to Recruiter_Screening.
- For Description, enter
Recruiter screening including entering the job application, scheduling and conducting the recruiter phone screen.
- For Select When to Complete the Stage, select When all steps have been marked Complete, the stage is marked Completed.
- Click Save and then click the X in the upper right corner to close the Edit window for the stage.
Add the First Step to the Stage
Now that we have our stage, it’s time to add our steps. In the previous unit, we identified three steps for this stage.
- Enter the job application
- Schedule the phone screen
- Conduct the phone screen
- In the Stage element, click Add Step.
- Click Interactive Step.
- For Label, enter
Create a job application
.
The API Name is automatically updated toCreate_a_job_application
.
- For Description, enter
Screen flow to create a job application.
- For Select When to Start the Step, select When the stage starts, the step starts.
- For Select an Action to Run, click in the Action field and select the Enter Job Application flow.
- For Set Input Values for the Selected Action, click in varPositionId to select Triggering Position__c > Record ID.
Use values from earlier in the flow to set the input variables for the referenced flow. Here we’re retrieving the Position ID for the job application we're creating.
- In the Select Someone to Complete the Action section, click the Assignee Type field and select User Resource.
You use User Resource to specify a resource that contains a user’s username when the orchestration runs.
- Click the User Resource field to select Triggering Position__c > Owner ID (User) > Username.
When you use the Username option, you'll see a list of available users in the org. This ensures that the user creating the Position record is identified as the recruiter. They will be assigned the appropriate work item immediately after the record is created. You want to avoid using hard coded user names in any automation.
- In the Select Where to Complete the Action section, click the Related Record ID field and select Triggering Position__c > Record ID.
Use this setting to link the specified record page to all assigned users. Work is completed in the Orchestration Work Guide component on the specified record page.
- For Select When to Complete the Step, select When the assigned user has completed the screen flow, the step is marked Completed.
- Click the X in the upper right corner to close the edit mode for this step.
Add the Second Step to the Stage
- Click Add Step.
- Select Background Step.
- For Label, enter
Notify candidate
.
The API Name is automatically updated toNotify_candidate
.
- For Description, enter
Notify candidate of screen.
- For Select When to Start the Step, select When another step is marked Complete, the step starts.
- Select
Create a job application
as the Step Name.
- In the Select an Action to Run section, click the Action field and select the Interview Email Notification flow.
- Under Set Input Values for the Selected Action, click in varCandidateId to select Recruiter Screening > Create a job application > Outputs > varCandidateId.
This uses a variable from a previous step (Create a job application) as an input for the current step (Notify candidate) to link the job with the phone screen.
- Click the X in the upper right corner to close the edit mode for this step.
Add the Third Step to the Stage
- Click Add Step.
- Select Interactive Step.
This step is going to ensure that the screen flow shows up in the work guide for the Recruiter.
- For Label, enter
Recruiter phone screen
.
The API Name is automatically updated toRecruiter_phone_screen
.
- For Description, enter
Screen flow to screen candidate.
- For Select When to Start the Step, click the Condition field and select When another step is marked Complete, the step starts.
- Select
Notify candidate
as the Step Name.
- In the Select an Action to Run section, click the Action field and select the Interview Screen flow.
- Under Set Input Values for the Selected Action, click the jobApplicationId field and select Recruiter Screening > Create a job application > Outputs > varJobApplicationId.
- In the Select Someone to Complete the Action section, click the Assignee Type field and select User Resource.
- Click the User Resource field and select Triggering Position__c > Owner ID (User) > Username.
- In the Select Where to Complete the Action section, click the Related Record Id field and select Triggering Position__c > Record ID.
- In the Select When to Complete the Step section, click the Condition field and select When the assigned user has completed the screen flow, the step is marked complete.
- Click the X in the upper right corner to close the edit mode for this step.
The Recruiter Screening stage is complete!
Add a Decision
Now it’s time to add the decision. This element performs the equivalent of an if-then statement. IF something is true, THEN take action; otherwise check if something ELSE is true. So, IF the candidate’s score is under 3, THEN they will not proceed in the hiring process. IF the score was greater than or equal to 3, THEN the candidate will be scheduled for an interview with the hiring manager.
- Between the Recruiter Screening Stage and the End element, click .
- Click Decision.
- For Label, enter
Go to next round
.
The API Name is automatically updated to Go_to_next_round.
- For Description, enter
Will the candidate advance to the next round.
- For Label under OUTCOME DETAILS, enter
Yes
.
The API Name is automatically updated to Yes.
- For Condition Requirements to Execute Outcome, select All Conditions Are Met (AND).
- Click in Resource to select Recruiter phone screen > Outputs > varReviewScore.
- For Operator, select Greater Than or Equal.
- For Value, enter
3
.
The candidate will advance if their score is greater than or equal to 3.
- You do not need to make any changes to Default Outcome as no conditions are needed.
- Click the X in the upper right corner to close the edit mode for this step.
- Click Save. You may see warnings that pop-up, you can close these for now.
The decision is added to the orchestration.
Completed Orchestration
After creating the decision, you add two additional stages: Hiring Manager Interview and Candidate Rejected. The decision element determines which stage is executed.
Hiring Manager Interview Stage (1)
This stage contains two steps. The candidate advances to the hiring manager interview if their overall score from the initial screening is greater than or equal to 3 out of 5. An interview is then scheduled with the Hiring manager (Notify candidate of hiring manager interview Background Step). Now it's up to the hiring manager to conduct the final interview (Hiring Manager review Interactive Step). They also use a screen flow to give their feedback.
Decision (2)
When the rating is submitted, the decision (Make offer) is fired to check if the manager wants to recommend this candidate for hire.
Candidate rejected Stage (3)
This stage contains only one step. If the candidate is rejected, a background step (Thank you for your interest Background Step) is run to create an automated email. The candidate is informed that their application won’t advance in the hiring process.
Activate the Orchestration
You can have multiple versions of an orchestration in Salesforce, but only one version can be active at a time.
To activate:
- In Flow Builder, open the orchestration version.
- On the button bar, click Activate.
If there’s a previous version already activated, it’s deactivated automatically.
Resources
- Salesforce Help: Deploy an Orchestration
- Salesforce Help: Flow Orchestration Resource: Global Variables