Core Actions

Below you'll find a list of Core Actions, as well as where they can be used, either in the Flow Editor, in the Function Editor, or both.

Change Location

Available in: Flow editor

Change locations to another behavior (node) in the Flow.

Validation enforces that you always change locations when necessary. In order to facilitate flow rendering, validation & analytics, you cannot change locations programmatically. A common pattern if you want to change locations programmatically is to programmatically set a session field and then visually condition off of that session field to determine the target of your location change action.

Set Field

Available in: Flow editor, Function Editor

Set a field to a specific value. In the case of Customer Assistants, can be used to set bot session fields, conversation goal states and conversation or contact custom fields. Can be invoked visually or programmatically. A common pattern is to set session fields programmatically and then later condition off of them visually in the Flow Editor.

Programmatic Payload Examples

Setting a session field

{
  "action": "setField",
  "field": "botSession.topic",
  "value": "order-status-lookup"
}

Setting a conversation custom field

{
  "action": "setField",
  "field": "conversation.custom.orderNumber",
  "value": "4242"
}

Setting a contact (customer) custom field

{
  "action": "setField",
  "field": "conversation.customer.custom.accountNumber",
  "value": "1234"
}
  • field: The field to set in JMESPath notation. Must point to session fields, custom fields or goals (setting of internal fields is not allowed)
  • value: The value to set. Must be legal according to the schema.

Set Field invocations with invalid values for value do not take effect.

Unset Field

Available in: Flow editor, Function Editor

Used to unset a field. This is the inverse of set field and can also be configured visually and programmatically.

Programmatic Payload Examples

Unsetting a session field

{
  "action": "unsetField",
  "field": "botSession.topic"
}

  • field: The field to set in JMESPath notation. Must point to session fields, custom fields or goals (setting of internal fields is not allowed)

See Set Field for more field reference examples.

Add to Field

Available in: Flow editor, Function Editor

Increase the value of a numeric field. Useful for maintaining counter values without knowing the current value. The application calls this action 'Add to Field' but programmatically it's referred to as 'incrementField'

_Programmatic Payload Examples

_Incrementing a numeric session field

{
  "action": "incrementField",
  "field": "botSession.correctQuizAnswers",
  "value": 1
}
  • field: The field to increment
  • value: The integer value to increment the numeric field by

Set Buffer

Available in: Function Editor

Set a named buffer to an arbitrary/opaque value.

You may encounter situations where you have a data structure in a function that you wish to store off and reference later in another function or perhaps even across user turns. If the data structure is non-atomic (e.g. a dictionary or a list) or if you're confident you don't need to author visual rules against it, then using a buffer may be a better choice than a session field.

If you set a buffer named bufferA as follows:

{
  "action": "setBuffer",
  "name": "bufferA",
  "value": {"foo":  "bar"}
}

Then it will be available in the context argument passed to your functions in context['buffers']['bufferA']. The value of a buffer can be any JSON serializable object and there's no need to declare a schema as these are opaque to the Flow Editor. Buffer values persist until they are overwritten or the session ends.

  • name: The name of the buffer to set which will be the key used to access it in context['buffers']
  • value: Any JSON serializable value including None

This is the only action that is programmatic-only. It is the successor to the deprecated setControlState action.

Log Debug Event

Available in: Function Editor

Log the current flow execution as an event in the Debug Workbench for further inspection. Note that test conversations initiated from the Chat Panel are implicitly logged as are any error scenarios that occur against a published assistant. Therefore, you may not need to explicitly configure this action.