The Hub is a place to share flows. It works similarly to an app store for flows where developers publish apps and users download and use them. In the Hub you publish and download flows.
Hubs can also exchange flows internally by configuring them to pull flows from another hub. In this manner we can setup a global hub containing flows that everyone can access, then we can e.g. setup a nordic hub which gets all the global flows but also contain some nordic-only flows. Going further we can setup e.g. a Danish hub which pulls flows from the nordic hub (and thus also gets the global flows) but which also contains some flows exclusive to the Danish hub.
A public facing Hub is available at https://demo.hub.sirenia.io/ from which flows published from our demo Cuesta instance can be downloaded.
In order to interface with a Hub instance from Cuesta you need to configure it with the location etc of the hub.
Each hub is defined with a name, url and and an auth token. Once Cuesta knows about at least one hub you can start to both publish flows to and get published flows from the hub. There are multiple workflows involved as described below.
You can add, edit and delete hubs by selecting the hub icon in the persistent menu on the left-hand side of the UI.
Each hub needs a name, a url designating the location of the hub and a token to authenticate itself. You can find/generate the token by logging into a hub with administrative access.
To see which flows from the registry has been published to a particular hub, you select the “Publications” tab.
You can publish any flow once or multiple times to the same hub. Use “hub” tab in the bottom flow menu.
This will bring you to a page on which you can publish the current flow.
Publish a new flow
After selecting the “Hub tab” you will be presented with options for publishing a new flow.
Here you can choose between publishing a single flow, or an inlined flow. Then you choose the hub to publish to and click create-new-publication and proceed to fill out the details for the publication.
When all looks good you need to press the “save” button in the bottom of the form.
You can use markdown and attach files to the publication by dragging them either to the description editor or the list of attachments.
Once you click publish, the flow will get packaged and sent to the hub for others to see and download.
Publish an update to an already published flow
If you’ve updated the source flow and you want to publish a new version, then you again go to the hub tab and an option to publish an update to the flow.
You must change the release version to publish an update and it is very, very much recommended to also add a new release note describing the changes from the latest published version. You can click the “N changes since …” link to see which changes you’ve made to the code since the flow was last published.
Clicking “save” will then publish a new version for others (or yourself to get). The change to be published will be tagged with the latest name and version published of this flow.
Errors when publishing
We validate that the published flow is given a name as well as a version.
When publishing a new version you also need to update the version (and optionally, but please do, the release note).
If you’re publishing an inlined flow then we also do a number of validations on the flow code itself. These will also be shown in the publication view:
Here, we are using a field
opt (in line 2 of the flow) that is defined with alternative matches and that cannot currently be handled by the inlining engine.
Get flows from a hub
You can get flows from a hub to via any connected Cuesta. This means that you can get a flow to the same Cuesta as the one that originally published it (as long as you change the name of the publication to not match the original flow). The idea behind this is that you can use the hub as a staging platform for production flows, i.e. publish flows when they are ready for prod while keeping a develop/test version that you can update independently of the production version.
There are multiple ways to get flows from hub.
Via links in the hub
The first will work if you’ve let Cuesta register itself as a handler for hub-links. In Chrome you do this by clicking the icon shown below and allowing the registration to take place.
Once this is done you can use the GET links from the hub to open an install page in Cuesta from where you can get the flow.
You will then be taken to a location in Cuesta where you can select the app in which to place the flow.
Via searching for the flow in Cuesta
If you want to get a published flow directly in Cuesta, then you can select the GET flow in the flow menu.
This will take you to a page where you can search for a flow to get.
This list will also display already downloaded flows s.t. you can update to new versions for existing flows.
Once you click “get flow” then the flow is downloaded to the local registry and you can start to make it available to users by assigning it groups etc
Updating a published flow to a new version
If you already have a version of published flow and a new version has been published, then you can update to this version by finding the published flow in the list of hub published flows (same as when you initially get the flow) or by going to the settings page for the flow. You’ll see information about the new version and controls to update in the top of the page.
A warning will also be shown (as you can see here) if you’ve modified your flow locally. By updating the flow, these modifications will get merged into the resulting flow or be overwritten by the new version depending on what you’ve changed. You can always revert to a previous version of a flow in the changes tab.
Whenever you get a new version of a flow, we’ll automatically tag the change to make it easier to rollback to a previously downloaded version.