Salesforce Platform Events is an event-driven messaging architecture enabling apps to communicate inside and outside of Salesforce.

Platform event can be used to communicate when Dynamo API task has been completed. Event can contain task ID to connect it with Task API post request.

Creating platform events

When custom platform event has been defined in Salesforce it’s ready to be used in DAP logic. Platform event can be created with create command:

create type=Dynamo_Event__e
  field name=TaskID__c value=${dynamoAPI.taskID}
  field name=Error value=${error}

In above example custom platform event has TaskID and Error fields.

TaskID field is used to store Dynamo API task ID also returned when posting the task through Dynamo API.

Error field is used to report any errors. Error variable is empty if no error occurred during DAP run.

Custom event can be extended with custom fields to return required data from template logic.

Platform event triggered flow

Platform event triggered flow launches when a platform event message is received. This flow type can be used to handle Dynamo API task events.