Employee Onboarding
Automate the full employee onboarding lifecycle. An orchestrator agent coordinates across IT provisioning, benefits enrollment, training assignments, equipment ordering, and compliance documentation: triggering specialized workflows for each domain and handling exceptions when systems conflict or approvals are needed.
Architecture
Deployment pattern: Agent-as-orchestrator (Pattern C). The agent is the decision-maker, and each sub-workflow is a capability it invokes through declared workflow tools. The agent decides sequencing, handles dependencies, and manages exceptions.
Sub-Workflows
The orchestrator coordinates four domain-specific workflows. Each is a standard Hyphen workflow that can also be run independently.
IT Provisioning Workflow
Provisions accounts across all required systems:
{
"name": "it_provisioning",
"definition": {
"actions": [
{
"type": "create_ad_account",
"properties": {
"first_name": "@input.first_name",
"last_name": "@input.last_name",
"department": "@input.department",
"role": "@input.role"
}
},
{
"type": "provision_email",
"properties": {
"username": "@input.email",
"distribution_lists": "@input.dl_membership"
}
},
{
"type": "assign_licenses",
"properties": {
"user_email": "@input.email",
"licenses": "@input.required_licenses"
}
},
{
"type": "grant_system_access",
"filter": {
"condition": {
"greaterThan": [{ "length": "@input.system_access" }, 0]
}
},
"properties": {
"user_email": "@input.email",
"systems": "@input.system_access"
}
},
{
"type": "PbotApproval",
"filter": {
"condition": {
"in": ["@input.access_level", ["admin", "elevated"]]
}
},
"properties": {
"comment": "New hire {{input.first_name}} {{input.last_name}} requires {{input.access_level}} access. Manager approval needed.",
"request_payload": {
"employee": "@input.first_name",
"role": "@input.role",
"systems": "@input.system_access",
"access_level": "@input.access_level"
}
}
}
]
}
}
Benefits Enrollment Workflow
{
"name": "benefits_enrollment",
"definition": {
"actions": [
{
"type": "check_eligibility",
"properties": {
"employee_type": "@input.employee_type",
"start_date": "@input.start_date",
"location": "@input.location"
}
},
{
"type": "create_benefits_profile",
"properties": {
"employee_id": "@input.employee_id",
"eligible_plans": "@eligibility.plans"
}
},
{
"type": "PbotForm",
"properties": {
"expected_keys": ["health_plan", "dental_plan", "vision_plan", "retirement_contribution", "life_insurance"],
"ttl_seconds": 604800,
"reminder_intervals": [172800, 432000]
}
},
{
"type": "enroll_benefits",
"properties": {
"employee_id": "@input.employee_id",
"selections": "@formData"
}
}
]
}
}
Training Assignment Workflow
{
"name": "training_assignment",
"definition": {
"actions": [
{
"type": "lookup_role_requirements",
"properties": {
"role": "@input.role",
"department": "@input.department",
"location": "@input.location"
}
},
{
"type": "loop",
"properties": {
"mode": "foreach",
"items_path": "@role_requirements.required_courses",
"item_variable_name": "course",
"actions_to_execute": [
{
"type": "custom-table",
"properties": {
"table": "training_assignment_queue",
"operation": "upsert",
"key_fields": ["employee_id", "course_id"],
"keys": ["employee_id", "course_id", "due_date", "status"],
"values": ["@input.employee_id", "@course.id", "@course.due_date", "ready"]
}
}
],
"max_concurrency": 5,
"failure_strategy": "fail_fast",
"result_key": "assignment_queue_writes"
}
}
]
}
}
Equipment Ordering Workflow
{
"name": "equipment_ordering",
"definition": {
"actions": [
{
"type": "lookup_standard_kit",
"properties": {
"role": "@input.role",
"location": "@input.location"
}
},
{
"type": "PbotApproval",
"filter": {
"condition": {
"greaterThan": ["@standard_kit.total_cost", 3000]
}
},
"properties": {
"comment": "Equipment order for {{input.first_name}} {{input.last_name}} exceeds $3,000. Items: {{standard_kit.items}}. Approve?",
"request_payload": {
"items": "@standard_kit.items",
"total_cost": "@standard_kit.total_cost"
}
}
},
{
"type": "submit_equipment_order",
"properties": {
"employee_id": "@input.employee_id",
"items": "@standard_kit.items",
"ship_to": "@input.work_location"
}
}
]
}
}
Orchestrator Agent
The top-level agent coordinates everything:
{
"name": "employee_onboarding_orchestrator",
"definition": {
"actions": [
{
"type": "loop",
"properties": {
"mode": "react",
"objective": "Start by reading the current employee with the supplied tool. Run IT provisioning, benefits enrollment, training assignment, and equipment ordering in order with the returned employee facts. A child workflow that pauses for a form or approval pauses this agent until the child can continue. If a workflow fails, pause for HR review. Send the welcome email only after the required workflows complete, then finish with the receipts and status of each step.",
"tools": [
{ "type": "action", "name": "read_current_employee" },
{ "type": "action", "name": "gmail_send" },
{ "type": "workflow", "id": "wfl-it-provisioning-001" },
{ "type": "workflow", "id": "wfl-benefits-enrollment-002" },
{ "type": "workflow", "id": "wfl-training-assignment-003" },
{ "type": "workflow", "id": "wfl-equipment-ordering-004" }
],
"model": "gpt-4o",
"max_iterations": 20,
"timeout_ms": 600000,
"on_stuck": {
"iterations": 4,
"action": "escalate"
},
"result_key": "onboarding_result"
}
},
{
"type": "custom-table",
"properties": {
"table": "onboarding_log",
"operation": "write",
"keys": ["employee_id"],
"values": ["@input.employee_id"],
"fields": {
"name": "@input.first_name",
"role": "@input.role",
"start_date": "@input.start_date",
"onboarding_status": "@onboarding_result.answer",
"completed_at": "@now"
}
}
}
]
}
}
Bind read_current_employee to your employee table with operation: "read" and where: { "employee_id": "@input.employee_id" }. The agent reads the current hire through a fixed tool before it invokes any child workflow.
Sample Agent Trace
Iteration 0:
Rationale: "I need the authoritative employee record before I invoke a child workflow."
Action: read_current_employee
Input: {}
Result: { "records": [{ "employee_id": "EMP-4521", "first_name": "Sarah", "role": "Senior Engineer", "department": "Engineering" }] }
Iteration 1:
Rationale: "The employee record is available. I can start IT provisioning with those facts."
Action: it_provisioning
Input: {
"first_name": "Sarah", "last_name": "Chen", "department": "Engineering",
"role": "Senior Engineer", "email": "[email protected]",
"required_licenses": ["GitHub Enterprise", "AWS Console", "Datadog"],
"system_access": ["production_k8s", "staging_db"],
"access_level": "elevated"
}
Result: { "status": "completed", "context": { "__approved": true } }
Iteration 2:
Rationale: "IT provisioning completed. Benefits enrollment is next and may pause for employee input."
Action: benefits_enrollment
Input: {
"employee_id": "EMP-4521", "employee_type": "full_time",
"start_date": "2026-02-15", "location": "San Francisco"
}
Result: { "workflow_run_id": "run_ben_789", "status": "paused", "awaiting": "human_review" }
When the child workflow pauses, the parent agent pauses with it. After the form or approval is settled, execution resumes from persisted state instead of launching the child workflow again.
Why Agent-as-Orchestrator
This template demonstrates why a human coordinator is the bottleneck in onboarding: they manually sequence across disconnected systems, track which steps are done, handle exceptions, and send follow-up communications.
The orchestrator agent replicates that judgment:
| Human coordinator does | Orchestrator agent does |
|---|---|
| Checks which systems need provisioning | Reads role requirements, triggers it_provisioning |
| Follows up on pending approvals | Waits for PbotApproval, escalates if stuck |
| Decides sequencing (IT before training) | Reasons about dependencies, runs workflows in logical order |
| Sends welcome email once ready | Sends email after confirming IT + training are done |
| Tracks overall status | __log_progress__ at each milestone |
| Escalates when things go wrong | __pause_for_human__ when workflows fail |
The result is one governed onboarding run per new hire, with explicit tool boundaries and a reviewable execution record.
Customization
HRIS integration: Replace @input with a webhook trigger from your HRIS (Workday, BambooHR, Rippling) that fires when a new hire record is created.
Sub-workflows: Add or remove sub-workflows based on your onboarding process: background check, office badge provisioning, parking assignment, team buddy assignment. Each is a standard Hyphen workflow the agent can invoke.
Approval routing: IT provisioning requires manager approval for elevated access. Equipment requires finance approval above $3K. Adjust thresholds and approval routing per your policies.
Timeline handling: Benefits enrollment uses PbotForm with a 7-day TTL and reminders at 48 hours and 5 days. The child workflow pauses the orchestrator until the form is submitted or expires, then the parent resumes from persisted state.
Offboarding: Mirror this template for employee offboarding: revoke access, recover equipment, process final pay, transfer knowledge base ownership. Same orchestrator pattern, reverse direction.