Flows

Express your conversational UX using flows written in BFML

Flows are made up steps that are executed in order. Flows are written in BFML or using a Visual Flow Editor (VFE) (coming soon!).

See an example of a BFML flow:

# requires:
#   order_id (str)

triggers:
  - keyword: order_return
    action:
      jump: start
      data:
        order_id: o-4

steps:
  - (start)
  - type: component.order.get
    order_id: (@ flow.order_id )
  - thread_set: order
  - type: component.product.get
    product_id: (@ thread.order.product_ids[0] )
  - thread_set: product
  - ask_form: Why would you like to return this item?
    label: Please specify reason
    composer:
      visibility: hide
  - flow_set: reason
  - say: >
      Thanks. Before we can approve your return, I need to bring a human to help.
      One moment, while I get someone...
  - flow: flow.escalate.ticket
    data:
      subject: '♻️ Return: Order #(@ thread.order.id ) - (@ thread.product.name )'
      comment: |
        order #: (@ thread.order.id )
        status: (@ thread.order.status )
        product: (@ thread.product.name )
        price: (@ "${:,.0f}".format(thread.product.price) )
        reason: (@ flow.reason )