Declarative state machine for content-lifecycle workflows