You can use the unique revision ID assigned to each workflow instance to revert to a previously saved workflow.
Retrieving the Revision ID
A revision ID is created whenever you edit and then save a workflow. To view revision IDs, select your workflow from the list of workflows in the console workflow section. Then you can either:
- Click the down arrow next to the New Run button and click ‘Customize Details.’ You see the workflow revision number.
- Click the Project Revisions tab. You see the workflow revision number, as shown in the following image:
You might want to revert when a workflow is accidentally erased, overwritten, or when unwanted changes are made and saved to the workflow.
To revert a workflow using the revision ID, you complete the following steps:
- Download the workflow that you want (the previous version)
- Push the downloaded workflow back into Treasure Data
Download the Workflow that You Want
From the command line using TD Toolbelt, issue a command in the following format:
td wf download workflow_name -r revision_id
For example, if the workflow you wanted to revise is named ‘sales_data‘ and Revision ID representing the version you wanted to revert to is
e295f5ff3ac4482a991b92db8fa0a8e0, then the command you issue is:
td wf download sales_data -r e295f5ff3ac4482a991b92db8fa0a8e0
A folder containing the workflow at the specified revision point is downloaded to current working directory.
Push the Downloaded Workflow Back into Treasure Data
Change your current directory to the folder that you just downloaded. Then, issue a command as follows:
td wf push workflow_name
For example, if your workflow is named ‘sales_data‘, then the command you issue is:
td wf push sales_data
Note that the name of the workflow you are pushing to Treasure Data must match the name of the workflow that you want to revert. After issuing the push command, the workflow is updated to to the Revision ID specified in your download command.