Asked by Sasika Nagaraj on Sep 3, 2024
Sasika has a blocking custom action that calls Lambda, which triggers an async worker. The action completes (unblocks) as soon as Lambda responds, but needs to wait until the worker finishes updating HubSpot fields.
Answered by Harun Kumar Siva
The issue is that the initial Lambda function is likely completing the callback immediately. For a blocking action to wait for an asynchronous process, the initial function (Lambda) should receive the request and the callback ID, start the worker, and respond quickly (e.g., 200 OK) *without* calling the HubSpot callback completion endpoint. The asynchronous worker, upon finishing its task (updating contact fields), should be responsible for making the final API call to `POST /automation/v4/actions/callbacks/{callbackId}/complete` to unblock the workflow.