Injecting Messages on a specific node for building approval workflows

Here's another way to do it using a subflow.

  1. Create a subflow to encapsulate the 'getting approval' process.

    The subflow includes an HTTP-In node that sets its url dynamically using a Subflow property - APPROVAL_URL.
    I've given the subflow two outputs - one for approved, one for denied - but of course you could do that however you wanted.
  2. In the Subflow properties, defined two properties:

    APPROVAL_URL is the property used in the HTTP In node. For convenience, this property is derived from another property - APPROVAL_ID. And I have configured the UI for the APPROVAL_URL property to be hidden.
  3. Then, you can add an instance of this subflow wherever you want:

    And when you edit its properties, you can set an identifier for the approval (ie the APPROVAL_ID property defined above:

    In this instance, that would cause the HTTP node to listen on /approval/go-fishing

You'd just need to make sure the APPROVAL_URL property is passed as part of the approval request so the response comes back to the right place.

3 Likes