# OHS Workflow Events

The Occupational Health & Safety module emits the following events for the workflow engine:

- `ohs.hazardCreated` – after a hazard record is created
- `ohs.inspectionScheduled` – when an inspection is scheduled
- `ohs.inspectionCompleted` – when an inspection update marks it completed
- `ohs.complianceTaskCreated` – after a compliance task is created
- `ohs.medicalRecordAdded` – whenever a medical record is logged
- `ohs.incidentCreated` – after an incident record is created
- `ohs.injuryLogged` – when an injury or medical event is reported
- `ohs.actionOverdue` – when a corrective action passes its target date
- `ohs.jsaReviewDue` – when a Job Safety Analysis requires a new review
- `leave.approved` – when a leave request is fully approved

Configure workflows with these `trigger_event` names to automate notifications or follow up tasks.

## JSA Review Configuration

1. Import `docs/jsa_review_due_workflow.json` via `/api/workflows/import`.
2. Set the `trigger_event` to `ohs.jsaReviewDue` and adjust the steps as needed.
3. Activate the workflow for the relevant tenants or departments.

## Workplace Injury Leave

1. Import `docs/workplace_injury_leave_workflow.json` via `/api/workflows/import`.
2. Set the `trigger_event` to `leave.approved`.
3. The provided steps update the `days_lost` on the linked incident and insert a basic medical record.
