> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ravenna.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Lifecycles and workflows

> Run a workflow when a lifecycle step opens, use the lifecycle's people, HR data and form answers in it, start lifecycles from HR events, and act when a lifecycle completes.

## Mental model

* Lifecycle Step trigger: inputs Template and Step (a Workflow step of the published version whose ticket opens in the workflow's workspace). One active workflow per step. The step completes when its step ticket closes, so the workflow should close it.
* Readable Form steps are the ones the step depends on, directly or transitively, that are shared or private to the workflow's workspace.
* Trigger outputs: Step ticket, Lifecycle ticket, Lifecycle ID, Template ID, Step key, Person, Anchor date, Step due, one value per stakeholder role, HR fields (HR: ...), and readable earlier Form step answers (`form_<snake_case step key>_<custom field id>`).
* Publishing the template and activating the workflow both validate the wiring.
* Start Lifecycle action: Template, Person or Person's email, Anchor date, Started by, Manager (defaults to the HR manager, then Other stakeholders), Other stakeholders (one person, fills every non-Manager role); outputs Lifecycle ID and Lifecycle ticket.
* Employee Hired / Employee Leaving triggers output Person and Date (yyyy-MM-dd). Lifecycle Completed outputs Lifecycle ticket, Lifecycle ID, Person, Template ID.


## Related topics

- [Build lifecycle templates](https://docs.ravenna.ai/documentation/automate/lifecycles/templates.md)
- [Run lifecycles](https://docs.ravenna.ai/documentation/automate/lifecycles/run.md)
- [Triggers & actions](https://docs.ravenna.ai/documentation/automate/workflows/triggers-actions.md)
- [Lifecycles](https://docs.ravenna.ai/documentation/automate/lifecycles/overview.md)
- [Workflows](https://docs.ravenna.ai/integrations/google-workspace/workflows.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.