Subscribe actions
With Subscribe Actions, you’ll receive near-instant webhooks as events occur in your customers’ SaaS applications. This enables your application to quickly react to events such as record creation, deletion, and field updates.
Subscribe Actions are in beta.
- They are currently only supported for Salesforce, and requires a Salesforce admin to install the integration.
- They do not produce Operations or Logs that can be viewed in the Ampersand dashboard.
Define a subscription
To subscribe to an object, you currently need to also have a read action specified for the object. In addition, you need to specify:
- objectName: to indicate which object you’d like to subscribe to. This should match the name of the object in the official documentation for the SaaS API.
- destination: the name of the destination that you’ve defined
- inheritFieldsAndMapping: for now, you must always set this to
true
to inherit the mapped and unmapped fields from the Read Action. Learn more in Fields and mapping.
You then need to specify the particular events you want to subscribe to. We support the following events:
-
createEvent: triggers when a new record is created in the SaaS application.
-
updateEvent: triggers when any existing record is modified. The
watchFieldsAuto: all
setting ensures that you subscribe to all field changes. In the future, you will be able to specify particular fields to subscribe to. -
deleteEvent: triggers when a record is removed from the system.
Adding full backfill
By combining subscribe actions with read actions, you can get a full picture of all the data in your customer’s SaaS instance. You can:
- Do a full backfill when the user first installs the integration to get historic data.
- Then, receive real-time updates about changes in their SaaS instance
Here is an example amp.yaml
:
If you do not wish to do a backfill when the integration is first installed, you can omit the backfill block in the read action definition. Because there aren’t any schedules or backfills defined, the read action won’t actually do anything but its fields and mappings will be used by the subscribe action.
Fields and mapping
Your read action’s set of fields and field mappings will apply to the subscribe action. When we deliver you the webhook, it will contain fields
and mappedFields
based on the fields and mapped fields from your read action. You can learn more in Object and field mapping. For the example above, this is what your webhook might look like:
Receiving data
You will receive webhook messages about events happening in your customer’s SaaS instance. These webhooks look very similar to the webhooks for read actions. See Subscribe Action Webhook Results for more information.
Was this page helpful?