Skip to content

Publish a workflow

Introduction

A workflow must be published in a runtime to become usable via NL Flow API calls or test calls. The same workflow can be published in multiple independent runtimes.

Inside a runtime, a published workflow is made of cluster pods that can be running or ready to run.
The correspondence between workflow blocks and pods depends on the component type of the individual block and the workflow mode (synchronous or asynchronous). You can find more details on synchronous and asynchronous workflow pods in the article on how workflows function.

A published asynchronous workflow can have zero running pods if autoscaling is enabled and has certain parameters. However, any workflow in the published status (green ring icon) is usable: turned-off pods can turn on when requests arrive and turn off again when there are no requests, but the workflow remains usable all the time, just with different responsiveness depending on how many pods are running at the time of the request.

Unpublishing a workflow from a runtime means making it unavailable in that runtime. Workflow pods are terminated and the computing resources that were are allocated to them are freed.

If a workflow has been published and users change it, they should re-publish it without unpublishing. This way the pods of the old version keep running—and responding—until the new start running, then they are terminated. This creates less or no downtime at all and is faster than unpublishing the workflow and publishing it again.

Start the wizard

You publish—or re-publish—a workflow using a wizard.
To start the wizard:

  • Open the workflow's workspace, select Publish or Async on the main toolbar at the top right of the page.
    The presence of Async means that, due to the use of some components like splitters, reducers, the Switch operator, etc., the workflow can only be published in asynchronous mode.

Or:

  • In the Runtimes view of the dashboard, select a connected runtime—it's status icon must be green—from the list on the left then:

    • Select Publish a new workflow on the right panel.

    Or:

    • Select a workflow from the list in central section of the page and select Republish workflow on the right panel.

The wizard consists of two or four steps, depending on whether the publishing mode is synchronous or asynchronous.

  • To cancel the wizard at any step select Cancel.
  • To go back to the previous step select Back.

First step

In the first step of the wizard you choose:

  1. The workflow to publish. Depending on where you started the wizard from, the workflow may already be determined, otherwise choose it from the Workflows drop-down list. For each workflow the list shows some details like Async if the workflow can only be published in asynchronous mode.

  2. The runtime to publish in. Depending on where you started the wizard from, the runtime may already be selected, but you can always choose another one from the Runtime drop-down list. For each runtime the list shows:

    • The runtime icon in the runtime item's identifying color.
    • The name of the runtime item.
    • The publishing modes (synchronous, asynchronous) that the runtime supports and, for asynchronous mode, the possible support for autoscaling, which allows publishing in Eco and Sport modes.
    • The other core features that the runtime provides.

    Runtimes that are incompatible with the workflow because they do not support the requested publishing mode or do not have all the core features required by the workflow blocks, are grayed out and cannot be selected.
    To find the exact issues with a grayed out runtime, hover over the lines showing its characteristics: tooltips will appear, showing the missing capabilities.

  3. Any API keys to associate with the publication. An API key is necessary to use the workflow via its API because a valid key must be included in every request to the workflow as an authorization mechanism, while it's not necessary, but doesn't create any issue if set, to test the workflow interactively.

    Info

    API keys can be already set in the wizard because NL Flow "remembers" the keys that were associated with the workflow during a previous publication in the same runtime, but you can add, change or remove them freely.

    • To associate an existing API key to the workflow:

      1. Select Add API key: a new drop-down list appears, showing available API keys.
      2. If you want to filter the list, type something in the field and the list will show only API keys with matching names. Clear the field to cancel the filter and see all the keys again.
      3. Select an API key from the list.
      4. Repeat from step a to link more keys.
    • To remove the association with an API key, select Remove to the right of the key.

    • To change an associated key, click its name. All API keys, if any, whose name contains that of the pre-selected key will be shown in a drop-down list, with the current key marked with a check mark.

    • To see additional API keys, edit the key name: all keys whose name contains what you type will be listed. If you remove all characters, all the API keys will be listed.

    • To make the change, select the new API key from the list.

    • To create a new API key and link it to the workflow, select Create new API key and do as described in the article about key creation.

When done select Next to move on to the second step of the wizard.

Second step

In the second step of the publishing wizard you:

  1. See the amount of computational resources required by the workflow and whether the runtime has sufficient capacity. As mentioned in the introduction, a published workflow is made of cluster pods. Pods require computational resources, that is CPU and RAM, to run.
    The amount of CPU and RAM required by the whole workflow is therefore the sum of the requirements of all its pods. This entire quantity of resources must be available inside the runtime at publish time even if, in the case of asynchronous publication with autoscaling, it is possible that not all of the pods are started immediately.
    The wizard steps shows the capacity of the runtime, the quantity already allocated to other published workflows and the difference due to the publishing of the current workflow.

  2. See if the publication is going to exceed some other limit of the runtime, such as the maximum number of workflows. Every runtime also has other two limits: the maximum number of workflows in can host and the overall, maximum number of blocks of version 1.0.0 of the JavaScript Interpreter processor that can be used in synchronous workflows.

  3. If the runtime has sufficient capacity to host the workflow, see or choose the publishing mode, between synchronous and asynchronous. The publishing mode is pre-set if the workflow is already published and you are re-publishing it after changes. You cannot change the publishing mode in this case; if you need to, cancel the wizard, unpublish the workflow and publish it again.
    Publishing mode can also be set to asynchronous and not modifiable if the workflow uses components that are only compatible with asynchronous mode.

In case of synchronous mode, this is the last step of the wizard, so just choose Publish workflow to start the publication process, otherwise select Next to go to the third step of the wizard.

Third step

This step is exclusive of asynchronous mode publication.

In the third step you have to check or change:

When done select Next to go to the fourth step of the wizard.

Fourth step

This step, as the previous, is exclusive of asynchronous mode publication.

In this step you have to decide whether to activate autoscaling and check or change the autoscaling parameters.
To disable autoscaling, choose Disabled, otherwise select one of the two presets, Eco or Sport. Then, if you want to create your autoscaling strategy, select Customize parameters. The parameters are shown and you can change them as desired.

When done, select Publish workflow to start the publication process.