You are not looking at the latest version of the documentation. Check it out there.
You are looking at draft pre-release documentation for the next release of Flows for APEX. Product features documented here may not be released or may have different behavior to that documented here. You should not make any purchase decisions based on this draft documentation..

Designing Message Flow Messages Structures

This page uses the message flow example in Tutorial 7b, and provides sample Message Header and Message Payload design to make a 3-way process collaboration work.

The Message Flow example in Tutorial 7b, shown below, takes a process involving three different companies, collsborating to buy, sell, and ship some goods in an order. In order to show a full demo of the interaction between the participants here, the diagram contains the inner working of the processes - even though they are taking place at three different companies.

Purchasing Example

Pro Tip: If you have the Enterprise Edition with the AskFlo AI Assistant connected, you can get information on the message structures in a collaboration. Use the β€˜Messaging’ quick action button to create a summary of all of the messages on a diagram. You can then ask the assistant for more information if required.

Note that opening messages, sent to a Message Start Event, typically contain just a message name - all of the information is in the payload because the receiving party is not yet aware of the transaction / process that you are starting. Once the process has been started, information known to both parties at that time can be used for message header keys.

Customer Messages

  1. Purchase Order (PO)

    • Message Name :purchaseOrder
    • Key Name and Key Value: null - because this message starts off a new process at its recipient.
    • Payload : json
    {
      "customer": "CustomerCo",
      "customerPO": "PO123",
      "dateRequired": "2024-12-30T12:00:00",
      "purchaseItems": [
        {"UPC": "24586356789", "qty_reqd": 20},
        {"UPC": "24586456862", "qty_reqd": 10}
      ]
    }
    
  2. Sales Order (SO) Confirmation

    • Message Name :salesOrder
    • Key Name :customerPO
    • Key Value :PO123
    • Payload : json
    {
      "supplierSalesOrder": "SO4567",
      "orderItems": [
        {"UPC": "24586356789", "qty_ordered": 20, "unit_price": 12.56},
        {"UPC": "24586456862", "qty_ordered": 10, "unit_price": 86.56}
      ]
    }
    
  3. Delivery Order

    • Message Name :deliveryOrder
    • Key Name :customerPO
    • Key Value :PO123
    • Payload : json
    {
      "ShipFrom": "MySupplierCo",
      "SupplierRef": "SO5678",
      "orderItems": [
        {"UPC": "24586356789", "qty_ordered": 20},
        {"UPC": "24586456862", "qty_ordered": 10}
      ],
      "mode": "air",
      "waybill": "45673647741578"
    }
    
  4. Invoice

    • Message Name :sendInvoice
    • Key Name :customerPO
    • Key Value :PO123
    • Payload : json
    {"the bill": "..."}
    

Supplier Messages

  1. Purchase Order (PO)

    • Message Name :purchaseOrder
    • Key Name and Key Value: null - because this message starts off a new process at its recipient.
    • Payload : Same as the Customer’s PO payload provided above.
  2. Sales Order (SO)

    • Message Name :salesOrder
    • Key Name :customerPO
    • Key Value :PO123
    • Payload : Same as the SO payload above for Customer.
  3. Shipping Instructions

    • Message Name :shippingInstruction
    • Key Name and Key Value: null - because this message starts off a new process at its recipient.
    • Payload : json
    {
      "ShipFrom": "MySupplierCo",
      "SupplierRef": "SO5678",
      "ShipTo": "MyCustomerCo",
      "CustomerRef": "PO123",
      "DateRequired": "2024-12-30T12:00:00",
      "orderItems": [
        {"UPC": "24586356789", "qty_ordered": 20},
        {"UPC": "24586456862", "qty_ordered": 10}
      ]
    }
    
  4. Delivery Confirmation

    • Message Name :deliveryConfirmation
    • Key Name :supplierSO
    • Key Value :SO5678
    • Payload : Same as the Delivery Confirmation payload below from the Shipper.
  5. Invoice

    • Message Name :sendInvoice
    • Key Name :customerPO
    • Key Value :PO123
    • Payload : Same as the Invoice payload above for Customer.

Shipper Messages

  1. Shipping Instructions

    • Message Name :shippingInstruction
    • Payload : Same as the Supplier’s Shipping Instructions payload.
    • Key Name and Key Value: null - because this message starts off a new process at its recipient.
  2. Delivery Confirmation

    • Message Name :deliveryConfirmation
    • Key Name :supplierSO
    • Key Value :SO5678
    • Payload : json
    {
      "ShipFrom": "MySupplierCo",
      "SupplierRef": "SO5678",
      "ShipTo": "MyCustomerCo",
      "CustomerRef": "PO123",
      "deliveredItems": [
        {"UPC": "24586356789", "qty_ordered": 20},
        {"UPC": "24586456862", "qty_ordered": 10}
      ],
      "mode": "air",
      "waybill": "45673647741578",
      "dateDelivered": "2024-10-02T08:47:00",
      "signedForBy": "Bill Smith"
    }
    

Adjusting the communication structure in this way ensures clarity and accuracy in representing the message exchanges as defined in the BPMN diagram.