Learn how to use JumpCloud Workflows to build automation that checks a user's department status, reactivates their account if necessary, and sends out email notifications.
The Scenario
Your HR team requests a check for a batch of returning contract workers. You need a workflow that you can trigger manually. It must evaluate if a user belongs to the “Contractor" department:
- If True: Reactivate their account and email them their activation details.
- If False: Send a notification to the IT email channel to flag the account for a manual review.
Creating the Workflow
- In the Workflows Overview page, click Add and select New Workflow.
- In the Create Workflow dialog, set the workflow type to Manual and click Next.
- Enter a unique, descriptive name (such as Manual Contractor Reactivation Check).
- Add an optional description to help other admins understand its purpose, then click Done.
Because this is a manual workflow, it requires an initial payload to run. - Click the Manual trigger card on your canvas.
- In the Input JSON field, paste the target user object payload. See JumpCloud Workflows Public API & DSL Guide to learn more.
To ensure this workflow handles different departments correctly, add an alternative decision path. - Click the + icon below your trigger card to add action.
- In the Action Type dialog, select Flows and then click If else.
- Configure the condition statement to check if the incoming “department” variable equals “Contractor”.
- Branch If (If the condition is True):
- On the If path of your If/Else block, click + to add an action node.
- In the Action Type dialog, under Custom Actions, search and select Reactivate user.
- In the canvas, click the action card to open the configuration pane and add user parameters using the field dropdowns. This action automatically sends an activation or reactivation email to the user. See Understanding Email Actions to learn more.
- Branch Else (If the condition is False):
- On the Else path of your If/Else block, click +.
- In the Action Type dialog, under Custom Actions, search and select the email action. See Understanding Email Actions to learn more.
- Use the user-friendly dropdown menus to select your corporate IT alert channel (e.g., it-alerts@company.com) to notify your team that a non-contractor layout was processed.
- Branch If (If the condition is True):
- Next, on the top pane, click Select next to Run As. Choose the narrowest role possible from the dropdown menu to perform these tasks. See Choosing the Execution Role to learn more.
- Click Save. Your workflow is now saved and enabled by default.
- Click the Run workflow icon next to the activation toggle, confirm your Input JSON parameters, and click Run Workflow. See Create Workflows to learn more.
You can review real-time execution progress and check for successful completions in the Execution history section.
Back to Top