{"revision":"c10276e953456835cdbb1f3a60d58ae1980be353","document":{"id":2310,"path":"application-development/releaseops/create-release-ops-pipeline.md","title":"Create a custom pipeline","bundle":null,"doc_type":null,"release":"australia","body":"\n# Create a custom pipeline\n\nCreate a custom pipeline to move changes from your development environment to production \\(or your target instance\\) by duplicating one of the ReleaseOps sample playbooks.\n\n## Before you begin\n\nRole required: releaseops.pipeline\\_admin and playbook.admin or pd\\_author\n\nFor more information about playbooks, see [Exploring Playbook](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/build-workflows/process-automation-designer.md).\n\n## About this task\n\nCustom playbooks and pipelines enable you to create deployment structures tailored to the unique needs of your organization's development environment. Custom playbooks and pipelines are best suited for deployment processes that are consistent and expected to occur during each release. For deployment processes that are more variable, you might consider adding runbook tasks instead of custom playbooks or playbook activities. For more information, see [Runbook tasks in ReleaseOps](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/application-development/releaseops/runbook-tasks.md).\n\n## Procedure\n\n1.  Duplicate one of the ReleaseOps playbooks.\n\n    **Important:** When creating a custom playbook, duplicate one of the ReleaseOps sample playbooks as your starting point. Don’t customize the ReleaseOps sample playbooks directly, so that you can continue to refer back to them as new features are added during instance upgrades.\n\n    1.  Navigate to **All** &gt; **Workflow Studio** and select the desired playbook.\n\n    2.  Enter a name for your new playbook and update any other required details.\n\n    For more information, see [Duplicate a playbook](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/build-workflows/duplicate-process.md).\n\n2.  Add or update stages in the playbook as desired.\n\n    **Note:** Certain stages make sense at certain parts of the flow. For example, the deployment analyzer runs before the deployment state **Move to test**. Other stages might need to be run after **Move to test** or after **Run ATF tests**. Typically, you shouldn’t add anything after **Ready for deploy**.\n\n    For more information, see [Add and configure a stage in a playbook](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/build-workflows/add-configure-stage.md).\n\n3.  Add or update decisions in the playbook as needed.\n\n    For more information, see [Decision activities](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/build-workflows/create-a-decision-activity.md).\n\n4.  Select **Activate** to finalize your updates and make your new playbook available for use.\n\n5.  Create a pipeline that leverages your new playbook.\n\n    1.  Navigate to **All** &gt; **ReleaseOps** &gt; **Pipelines** and select **New**.\n\n    2.  Give your pipeline a name, and select playbooks for the **Assessment playbook** and **Release playbook** fields.\n\n        You can use your own custom playbooks for both, or use a combination of custom and sample playbooks.\n\n    3.  Select and hold \\(or right-click\\) the header on the Pipeline form and select **Save**.\n\n6.  On your newly created pipeline, locate the Pipeline instances related list and select **New**.\n\n    1.  Select the label `Test.`\n\n    2.  Select your deployment instance.\n\n    3.  Select **Submit**.\n\n\n## Example: Create an assessment playbook\n\nCreate a custom pipeline to move changes through your non-production environment by duplicating the Deployment Request Assessment playbook. Add the deployment analyzer to detect if there are code changes in the deployment and skip Automated Test Framework \\(ATF\\) tests during assessment.\n\n### Before you begin\n\nRole required: releaseops.pipeline\\_admin and playbook.admin or pd\\_author\n\n### Procedure\n\n1.  Duplicate the Deployment Request Assessment playbook.\n\n    1.  Navigate to **All** &gt; **Workflow Studio** and select the **Deployment Request Assessment** playbook.\n\n    2.  Select **Duplicate** from the More actions menu.\n\n    3.  Enter a name for your new playbook and update any other required details.\n\n2.  Add a new stage to the playbook by selecting the + icon after Start, and enter a label, for example `Analyze Deployment`.\n\n    **Note:** Certain stages make sense at certain parts of the flow. For example, the deployment analyzer runs before the deployment state \\(Move To Test\\). Other stages might need to be run after Move to Test or after Run ATF Tests. Typically, you shouldn’t add anything after Ready for Deploy.\n\n3.  Add the **Run Deployment Analyzer** activity.\n\n4.  Select the newly added Run Deployment Analyzer activity to configure it.\n\n    1.  Select the **Automation** tab on the additional options modal.\n\n    2.  In the Inputs section of the modal, select the icon and then select **Parent Record - Deployment Request**.\n\n    3.  Select **Save and close**.\n\n5.  Locate the Run ATF Tests section of the playbook, and add a new decision after the Transition to Assessing activity by selecting the + icon, and then selecting **Add a decision \\(if/then\\)**.\n\n    For more information, see [Decision activities](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/build-workflows/create-a-decision-activity.md).\n\n6.  Select the newly added decision to configure it.\n\n    1.  Select the **Branches** tab, and enter a label, for example `Skip Tests`.\n\n    2.  Select **Add Condition**.\n\n    3.  From the Field dropdown menu, select **1.1 Deployment Analyzer** &gt; **Outputs** &gt; **Has Code Change**.\n\n    4.  Select **is** from the Operator dropdown menu.\n\n    5.  Select **false** from the True/False dropdown menu.\n\n    6.  Select **Save and Close**.\n\n7.  Hover over the Skip Tests branch, select **Drag new connector** icon, and drag the connector to the junction after the Create Test Failure Task.\n\n    Confirm that the default branch is connected to Run ATF Tests for Deployment.\n\n8.  Select **Activate** to finalize your updates and make your new playbook available for use.\n\n9.  Create a pipeline that leverages your assessment playbook.\n\n    1.  Navigate to **All** &gt; **ReleaseOps** &gt; **Pipelines** and select **New**.\n\n    2.  Give your pipeline a name, and select your newly created playbook in the **Assessment playbook** field.\n\n    3.  Select and hold \\(or right-click\\) the header on the Pipeline form and select **Save**.\n\n10. On your newly created pipeline, locate the Pipeline instances related list and select **New**.\n\n    1.  Select the label `Test.`\n\n    2.  Select your deployment instance.\n\n    3.  Select **Submit**.\n\n\n### Result\n\nYour custom pipeline, which leverages the custom playbook you created from the default Deployment Request Assessment playbook for its assessment stage, is now ready for use.\n\n**Note:**\n\n-   The pipeline instance label \\(in the example above, the `Test` label entered for step 10a\\) is used to map the instance definition with the instance as referenced in the playbook. Mapping the instance definition with the instance label enables a playbook to be used by multiple pipeline definitions with different topologies \\(but the same process\\). For example, you can create another pipeline record and associate it to the same playbooks, but define a different test instance mapping.\n-   The source instance for the playbook is defined in the deployment request, so you can have multiple source or development environments for one release.\n-   The destination instance is defined in the release, so you can reuse the same pipeline to release to multiple destination or production environments.\n-   Only intermediate instances must be mapped.\n\n"}}