Creating your first workflow
Workflows are defined by one Transposit Dev Platform application and implement a functionality end-to-end (E.g. merge a change on Jenkins). You may also need to set up authorization and some configuration in order for a workflow to run.
An action is a way to trigger a workflow with authentication and configurations (called environment variables in the Transposit Dev Platform). When a user adds an action, they are configuring a workflow to be ready to be used. A runbook step can contain various actions.
Creating your first workflow
- Create your first runbook: In the Runbooks section in the left sidebar, you will create a new runbook. This will be the runbook you develop from. For now, you don’t really need to put anything in there, but you do need to Save it.
- Fork sample application: Go to this sample application and fork this app at the top of the page. Make sure to change the owner to the name of your organization, not your personal account.
- Add context parameter: Make sure you have a “context” parameter (type: object) in every operation of your application. This can be found in the right column of the text editor.
- Deploy workflow: In your application in the Transposit Dev Platform, go to Deploy > Mission Control and select your input (typically input_prompt) and execution operations (execute_js). You should use the latest tag for ease of development.
- Create an action: Go back to the main Transposit site and add actions to your team by going to the Actions section in the left sidebar. Select the workflow you just created and input any environment variables (if needed). Your workflow needs to be deployed to show up in the workflow picker. If you don’t see it, go back and give it a version in the commit code modal in the Transposit Dev Platform.
- Add an action to your runbook: Go back to the Runbooks section in the left sidebar and return to the runbook you created in step 1. In the Edit mode of a runbook, add a step to your runbook. Steps are delimited by H2s in Markdown. For example:
## Investigate. Click the Add action button at the top. Select the action you just created and save.
- Trigger an alert in Slack: You will trigger an alert based on the set up docs. See step 4 (I.e.
curl [endpoint_url]). A message will be posted in the channel you previously setup and you can create your incident. In the incident Slack channel, open the runbook you created, click your action button, and hopefully you see your input operation being run!
Runbooks and actions are re-loaded at every step, meaning if you make a change to an action or runbook you can return to the Browse Runbooks page and re-select it and it should show the updates (or even page to the next step and come back). Use /transposit to open the last runbook page you were on before you closed it.
If you want to better understand the operations that workflows use, learn error handling best practices, learn more about authentication, and more workflow concepts, see our Workflow concepts & best practices doc.