Webhook Initiate too fast
Hi, I've created a job in Azure Automation to do an inventory through the API's of companies registered in Twenty CRM (v0.54.6). THe import job is importing the company data to a sql db. THe job is triggered with a webhook coming from TwentyCRM. When I create a Company, the webhook is triggered to early, i have not completed to fill out all the information before the job gets triggered by the webhook. So the import job only gets the company name and address information. I have plenty of custom data fields added to the company dataset. but that is only present in TwentyCRM and not in SQL db due to the early trigger from the webhooks.
When I run the import job manually I get all the data when the company is created. SO I could solve it with an initial delay in the automation job. but I think it's better to solve it from the Twenty CRM system side
6 Replies
Maybe when adding a company through the GUI there should be a save button to complete the registration of a company. The save action should trigger the POST webhook instead, just a thought
Hey @nickponcho thanks you for reaching us. What datasase évents are you listening to trigger your webhook (look in webhook settings to figure that out)?
You probably listen create event, maybe you should also listen for update events
Hi, I mainly go with the create event, but if I choose to also use the update event every attribute i change will trigger an event so if I change 3 attributes, then 3 POST events will happen instead of 1 with all information. That is of course useful in other scenarios but not for all
I tried to use update on "peoples" when adding and updating. It triggered 5 separate automation jobs to update 1 person. THis is where the update or save functionality comes in handy, to trigger the POST to webhook event
ok, i see. I think workflow might fit your need. you can create a workflow called like "Import record" with a manual trigger and a code step that calls your azure automation with record data.

Then, when you completed to fill your record, you can select it and call the "Import record" workflow

axios package is available in workflow code step to make the POST call
tell me if it could fit your needs or if you need any help to configure this workflow