Awell Health Developer Hub
Dev Hub

hello

the onActivityCreated function has been deprecated as of September 1, 2024. Please use the onEvent function.

The onActivityCreated function is called whenever orchestration or design (preview) activates a Custom Action. It will publish a message that is received by the extension server, which automatically finds the right Custom Action and calls the onActivityCreated function defined in that action.

onActivityCreated with callbacks

The onActivityCreated function has a couple of parameters that will be useful when developing an extension:

  1. Payload: not only gives you access to the values of your extension settings and action fields but also to patient and pathway-related data.
  2. Callbacks: they allow you to communicate with the Design (preview) or Orchestration engine and delegate back control to them. An extension should either call the onComplete or onError function.
01

Payload

The payload allows you to access the values of your extension settings, action fields, and patient data.

01

onComplete callback

The onComplete callback can be called to confirm your activity has been completed and can be called with the following (optional) parameters:

  • Data points: allows you to ingest values in the pathway through data points which can then be used by the pathway builder for conditional logic, variables, and more.
  • Events: activity events can be used to provide more granular info on what the extension does. These events will be displayed under the "updates" tab in Awell Studio & Awell Care.
01

onError callback

The onError callback can be called to let Awell know something went wrong with running your extension code. However, the activity will still be completed.

The function can be called with the following (optional) parameter:

  • Events: activity events can be used to provide more granular info on what the extension does. These events will be displayed under the "updates" tab in Awell Studio & Awell Care.
01