Server

HOWTO: Create an Automation Chain

Updated: December 19, 2024

This guide explains how to create and configure an automation chain using Nuxeo Studio.

This is done in two steps:

  1. Create the chain.
  2. Bind it to a button, an action, or an event handler.

Create an Automation Chain

To create an automation chain:

  1. In the left menu, click on Automation and then on Automation Chains.
  2. Click on the New button.
  3. Give your automation chain an ID and click on the Next button.
    NXS-automation-create.png
    NXS-automation-create.png
    The automation chain editor is displayed.

    The Fetch > Context Document(s) is automatically added as the first operation of the chain.
  4. If needed, remove the Fetch > Context Document(s) and replace it with another Fetch operation. The Fetch operation feeds the chain with some document input, whether it is one document or a list of documents. There are various ways to fetch:
    • Context document will bring either the UI Current document, or the document attached to the event (depending on what you bound your operation chain, see later).
    • Fetch Query will bring back the result of the query as a document list.
    • Get Document fetches a document by its path.
  5. Start to drag and drop operations in the flow, respecting their input and output types. Leverage context and scripting capabilities to capture and reuse information all along the flow.

    validateDocument-chain-studio.png
    validateDocument-chain-studio.png

    Click on the Switch editor button to write your chain in YAML or paste a chain copied from a how-to for instance.

  6. Save your chain. You now need to bind your automation chain by creating a new action or a new event handler.

Automation Chain Binding

Binding the automation chain to a button, an action or an event handler is done in the Buttons menu in Studio Designer.

To an Action

To bind the chain to a button/action:

  1. In Designer, go to Actions menu and hover over the + button and select Operation
  2. On the creation form, on the Element Binding section:
    • Give your action a name, a slot type (the schema on the right will help you check where your action will be displayed), choose an icon, a label.
      NXS-action-edition-1.png
      NXS-action-edition-1.png
    • On the Operation field select the automation chain to which you want the action to be bound.
      NXS-action-edition-form-2.png
      NXS-action-edition-form-2.png
    • On the Activation filter give the necessary filtering information, to target your action to the right context.
  3. Click on Save.

To an Event Handler

To bind the chain to an event handler:

  1. On Studio Modeler side, go to Automation > Event Handlers and click on the New.
    Give your Event Handler a name and click on Ok.
    NXS-event-handler-creation.png
    NXS-event-handler-creation.png
  2. Choose to which events the event handler should be bound (documentCreated, documentUpdated...) and indicate whether the chain should be run synchronously or asynchronously.
    NXS-event-handler-edition-form-1.png
    NXS-event-handler-edition-form-1.png
  3. In the Event handler Activation section, fill in the filtering information, to target your event handler to the right context.
    NXS-event-handler-edition-form-2.png
    NXS-event-handler-edition-form-2.png
  4. Choose the automation chain to which you want the event handler to be bound.
    NXS-event-handler-edition-form-3.png
    NXS-event-handler-edition-form-3.png
  5. Click on the Save button.