Workflow: Save Workflow File

This blog post covers the second sub-workflow of the blogging workflow process described in the Blogging About Workflows blog post.

This workflow I don’t tend to use as part of the process of creating my blog post information. Rather it is a way of giving myself a backup of the workflow in case I need to restore it and find for some reason that the online page is unavailable. Remember it is easy and painful to not have enough backups and only slightly more effort and a lot less pain to have enough … I’ve yet to meet someone who has too many. Also since this runs as a fully automated part of my blog post preparation process it really is no effort to have it included and run.

The workflow begins by capturing any input parameter and then proceeds on the basis that the the URL to the download page is on the device clipboard (note that I always start the workflow off by first using the Copy Link sharing option from the workflow itself to get that URL onto the clipboard).

Next it uses a replace action on that URL to strip the domain and first directory element from it. This leaves the unique ID assigned to the workflow.

It then uses the full URL to capture the content of the download page using a Get Contents of URL action, and just like the Save Workflow Name and Link workflow it then grabs the title and changes it from HTML to rich text to get the name of the workflow.

Now the workflow skips back to using the unique ID. It inserts this into a URL for Amazon Web Services which is the platform on which the workflow download pages are hosted. This URL however is the direct file link to download the workflow file. The URL is downloaded and its name (i.e. file name) is set to the following format - “{workflow name}(workflow ID}.wflow; and then automatically saved into my workflow Dropbox directory. Should the file somehow already exist it will be overwritten.

The last step uses the workflow input to pass control back to another app/workflow. In the case of the blogging process it goes back to the DocFlow workflow. If no input parameter was received then the Open X-Callback URL action will do nothing.

The details of the workflow can be seen below and you can also download this Save Workflow File workflow.

Author: Stephen Millard
Tags: | workflow |

Buy me a coffeeBuy me a coffee

Related posts that you may also like to read