Fluent Commerce Logo
Docs
Sign In

Adding a User Action to your Workflow

How-to Guide

Author:

Fluent Commerce

Changed on:

16 Nov 2023

Key Points

  • User actions allow to manually trigger specific events in the Workflow.
  • User Actions can be added, changed, or removed.
  • User actions can be added via UI or via the Workflow JSON.

Steps

Step arrow right iconAdding a User Action to your Workflow

Adding a User Action to your Workflow via the UI

User Actions

The User Actions section provides the option to link human interactions and automated workflows, and allow orchestrated business logic to apply to buttons on the Fluent OMS and Fluent Store applications.

No alt provided

You can add, change, or remove User Actions from this section.

To configure a User Action, either click on the "Add User Action" button or click on the existing User Action button. This will slide out an additional screen section to the left of the Edit Ruleset area.

The User Action screen has four fields; Button Label, Type, Modules, and Confirmation Required.

Working with User Actions

User Actions provide the ability to integrate human interaction with orchestrated workflows and business logic. This brings powerful capabilities to the User Interfaces used by users both in store and from head office.

Clicking on the "Add User Action" button will slide out the User Action form on the left of the Ruleset panel.

Configuring User Actions involves linking a Button Configuration with a Trigger and a Ruleset.

1{
2    "name": "OrderCancel",
3    "description": "Order is Cancelled from Fluent",
4    "type": "ORDER",
5    "subtype": "HD",
6    "eventType": "NORMAL"
7    
8}     

Language: json

Name: Example

Description:

[Warning: empty required content area]

This is controlled when accessing the workflow via the Import/Export link to view the workflow in JSON format.

User Action button configuration

Button configuration captures the button label, button type, modules to be displayed, and 'Confirmation Required' check.

Button label is a required field and provides the label that will be printed on the button when displayed on the User Interface.

Button Type is also required and can be either Primary or Secondary. This indicates whether the button is displayed as a Primary or Secondary action in the UI. Secondary actions may not be visible without click on an ellipses button for extended options first.

The Modules selector allows users to assign the Button to a web app, such as the Fluent Store or Fluent OMS. At least one Module is required. The web apps available for selection can be configured via an Account level Setting, 

`fc.mystique.apps`
. See here for more information.

Finally, the 'Confirmation Required' checkbox indicates whether or not the UI should prompt the user for confirmation of the action, prior to execution.


Adding a User Action via the Workflow JSON

User Action schema

JSON Key

Value Type

Mandatory

Description

eventName

String

YES

Name of the Ruleset that contains the User Action

context

Array

YES

An array that contains information about where the User Action will appear and if it requires a confirmation step. See the Context schema below for more information.

attributes

String

No

Attributes that can be collected via the confirmation Modal.

CONTEXT SCHEMA

JSON Key

Value Type

Mandatory

Description

label

String

YES

The label of the button produced by the User Action in the UI

type

String

YES

Determines the button type. There are two accepted values, 

`PRIMARY`
 and 
`SECONDARY`

modules

Array

YES

Determines what App or UI Manifests the User Action will appear in. To make a user action appear in Fluent Store add 

`store`
 or for Fluent OMS add 
`oms`
. You can also add User Actions to custom apps by adding in the Manifest's app name. For example, to add a User Action to an app using the following custom Manifest 
`fc.mystique.manifest.custom`
, add the value 
`custom`
.

confirm

Boolean

YES

Determines if a User Action must be confirmed via a confirmation Modal.

User Action sample
1{
2  "userActions": [
3    {
4      "eventName": "{{eventName}}",
5      "context": [
6        {
7          "label": "{{label}}",
8          "type": "{{type}}",
9          "modules": [
10            "{{modules}}",
11            "{{modules}}"
12          ],
13          "confirm": false
14        }
15      ],
16      "attributes": []
17    }
18  ]
19}

Language: json

Name: User Action sample

Description:

[Warning: empty required content area]

Troubleshooting a User Action

When a User Action is triggered, i.e. a button on the UI is clicked & confirmed, an External Event is triggered using the event/sync Event API endpoint. To investigate the payload and the result of the event execution the browser’s Developer Tools can be used (see Overview - Chrome Developers).

The “Network” tab will contain the details of the Event API call performed including information such as:

  • Request URL
  • Bearer token
  • Event payload
  • Response event id
Request Headers
No alt provided
Event Payload
No alt provided

With the information provided the exact API call can be investigated and if required replicated.

Fluent Commerce

Fluent Commerce