{"revision":"c10276e953456835cdbb1f3a60d58ae1980be353","document":{"id":29073,"path":"it-operations-management/cloud-configuration-governance/add-postprov-example-subflows.md","title":"Add pre- or post-provisioning operations to a catalog item","bundle":null,"doc_type":null,"release":"australia","body":"\n# Add pre- or post-provisioning operations to a catalog item\n\nCreate a post-provisioning operation using subflows on a template-based catalog item.\n\n## Before you begin\n\nVerify that the Orchestration application is installed.\n\nRole required: Cloud user, designer, admin, sn\\_cmp.cloud\\_service\\_designer\n\n## Procedure\n\n1.  In the Cloud Admin portal, navigate to **Design** &gt; **Cloud Catalog Items**.\n\n2.  Open a catalog item.\n\n3.  Select the **Pre Provisioning Operation** or **Post Provisioning Operation** tab.\n\n4.  Select **New**.\n\n5.  From the **Step Type** list, select **Flow**.\n\n6.  Select the Search icon on the **Flow** field.\n\n7.  From the **Subflow** look-up list, select an active subflow.\n\n    The look-up table lists all active flows and subflows in the instance.\n\n    **Note:** You cannot invoke flows while adding a resource operation step. This is a known limitation.\n\n8.  In the **Order** field, specify an order for this operation.\n\n9.  Enable the operations by selecting the **Enabled** check box.\n\n10. Select **Submit**.\n\n    The subflow operation step is attached to the catalog item and appears on the Pre-Provision Operation or Post-provision Operation related list.\n\n11. Select the subflow operation step from the relevant related list to add or modify input parameters.\n\n    **Note:**\n\n    When creating a post-provision action, include **CMPTfeReturnAction** as the final step in the flow.\n\n    Verify the following steps:\n\n    -   Verify that control returns to the main order so that data and responses flow back correctly and the process closes successfully.\n    -   Configure parameters to indicate whether the step resulted in an error.\n    -   Send an error from this action if the step is designed to fail.\n    -   Include the correlation ID. The flow will not function without it.\n    Any input parameters associated with the subflow you selected are auto-populated on the Key Values related list.\n\n\n## What to do next\n\n-   Verify that the `flowcorrelationid` input parameter is created in the subflow with the following expression string:\n\n    |Key|Value|\n    |---|-----|\n    |`flowcorrelationid`|`$(Script:CMPFlowStepHandler.generateCorrelationId)`|\n\n-   To check whether the flow completes successfully, see [Create a response action for Cloud Provisioning and Governance.](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/it-operations-management/cloud-configuration-governance/create-subflow-action-cloud-provision-governance.md)\n\n"}}