{"ref":"capability:status-flows","page":"/capabilities/status-flows","json":"/capabilities/status-flows.json","generated":"2026-10-26","drafted_with_ai":true,"entity":{"id":"status-flows","name":"Status flows","domain":"process-and-workflow","ecosystems":["cap"],"universal":false,"description":"Declaring in the model which status transitions an entity may make, so the runtime rejects a transition nobody declared and sets the status itself when the bound action runs, instead of a check written by hand in every handler. Not [input validation](capability:input-validation): that checks a value, this checks a transition. Not [workflow integration](capability:workflow-integration): that drives an external engine, and this stays inside the model.","short":"Declaring allowed status transitions in the model","core_coverage":{"state":"core-only","assessed_at":"2026-09-19","what_core_does":"Three annotations model a flow: @flow.status marks the status element on an entity, and @from and @to on a bound action state its valid entry states and its target state. A generic handler rejects an invocation whose current state is not one of @from's with a 409 Conflict, and another updates the status to @to once the action has run; Node.js has this built in, and for CAP Java it ships as the feature [com.sap.cds:cds-feature-flow](artifact:cap-java-cds-feature-flow), added to srv/pom.xml as a runtime dependency.","where_it_stops":"Only bound actions can be flow-controlled: plain CRUD and draft operations cannot be restricted by a flow. On a draft-enabled entity every action is disabled while a draft is open, so a transition can only be performed on the active instance.","sources":[{"url":"https://cap.cloud.sap/docs/guides/services/status-flows","title":"Status-Transition Flows","checked":"2026-09-19","quote":"Annotation @flow.status is an entity-level annotation that identifies the status element for which to establish a status-transition flow."},{"url":"https://cap.cloud.sap/docs/guides/services/status-flows","title":"Status-Transition Flows","checked":"2026-09-19","quote":"Based on the @from annotation, a generic handler validates that the entity is in a valid entry state - the current state must match one of the states specified in @from. If validation fails, the request returns a 409 Conflict HTTP status code with an appropriate error message."},{"url":"https://cap.cloud.sap/docs/guides/services/status-flows","title":"Status-Transition Flows","checked":"2026-09-19","quote":"Based on the @to annotation, a generic handler automatically updates the entity's status to the target state."},{"url":"https://cap.cloud.sap/docs/guides/services/status-flows","title":"Status-Transition Flows","checked":"2026-09-19","quote":"In CAP Node.js support for flows is built-in and available out of the box. For CAP Java, it is provided by the feature cds-feature-flow."},{"url":"https://cap.cloud.sap/docs/guides/services/status-flows","title":"Status-Transition Flows","checked":"2026-09-19","quote":"Status-transition flows also work with draft-enabled entities, however when in draft state all actions are disabled. Thus, status transitions can only be performed on active entities."},{"url":"https://cap.cloud.sap/docs/guides/services/status-flows","title":"Status-Transition Flows","checked":"2026-09-19","quote":"CRUD and DRAFT operations can't be restricted by status-transition flows today. Only bound actions can be flow-controlled."}]},"drafted_with_ai":true},"sap_delivery":{"door":"cap","all":{"built_in":[{"ref":"artifact:sap-cds","name":"@sap/cds","json":"/artifacts/sap-cds.json"}],"documented_pattern":[],"announced":[],"packages":[{"ref":"artifact:cap-java-cds-feature-flow","name":"com.sap.cds:cds-feature-flow","json":"/artifacts/cap-java-cds-feature-flow.json"}]},"by_flavor":{"node":{"built_in":[{"ref":"artifact:sap-cds","name":"@sap/cds","json":"/artifacts/sap-cds.json"}],"documented_pattern":[],"announced":[],"packages":[]},"java":{"built_in":[],"documented_pattern":[],"announced":[],"packages":[{"ref":"artifact:cap-java-cds-feature-flow","name":"com.sap.cds:cds-feature-flow","json":"/artifacts/cap-java-cds-feature-flow.json"}]}}},"edges":{"use_cases":[],"shared_tasks":[],"related_tasks":[],"options":[{"ref":"artifact:sap-cds","name":"@sap/cds","json":"/artifacts/sap-cds.json","ecosystem":"cap","origin_ring":"sap-official"},{"ref":"artifact:cap-java-cds-feature-flow","name":"com.sap.cds:cds-feature-flow","json":"/artifacts/cap-java-cds-feature-flow.json","ecosystem":"cap","origin_ring":"sap-official"}],"samples":[],"explained_by":[{"ref":"content:teched-2026-ad162","name":"Everything new: Try out the latest features in CAP","json":"/content/teched-2026-ad162.json"}],"normative_context":[]}}