Step 1: Create a new template file
Create a file that contains the code you wish to execute when you move assets through the workflow. This file can be a part of an existing template or a new template can be created. For example, if you create a new template, you can rename the output.aspx file to workflow_script.aspx.
Step 2: Open the workflow you want to apply the script to
1. Navigate to Settings > Workflow > Workflows
![workflow-script-01.JPG workflow-script-01.JPG](https://community.crownpeak.com/t5/image/serverpage/image-id/372i7A706D85B9373BE6/image-size/large?v=v2&px=999)
2. Double click on the [Workflow Name] to edit the worklfow.
Step 3: Update workflow states that should execute the script
1. Click on the workflow state that should execute the script.
![workflow-script-02.JPG workflow-script-02.JPG](https://community.crownpeak.com/t5/image/serverpage/image-id/373iF2C96241CB1FD6F0/image-size/large?v=v2&px=999)
2. In the Execute File field of the modal popup select the template file you created in step 1.
![workflow-script-03.JPG workflow-script-03.JPG](https://community.crownpeak.com/t5/image/serverpage/image-id/374i949E38C6E82DA06A/image-size/large?v=v2&px=999)
3. Hit Ok to the modal popup.
4. Save the workflow.