How do I know if I got success in my cloud task? Is there a way to configure a webhook?

Hi there

I have a biling application that send a request to a bank in order to create an invoice.

I need to receive a callback to create an e-mail and send this invoice to our client.

I tried to get this status with getTask(), althought, it is not appropriate, once the task is finished, I cannot know if it got success or not.

How do you guys handle with that?

1 2 183
2 REPLIES 2

Hello @edudesouza,

You can use the Cloud Task API to see the status of a task attempt. This will show the status of the task attempt with the following JSON representation:

{
  "scheduleTime": string,
  "dispatchTime": string,
  "responseTime": string,
  "responseStatus": {
    object (Status)
}
}

You can also take a look at this StackOverflow post as it covers how to get Google Cloud Task status.

If the above option doesn't work, you can contact Google Cloud Support to further look into your case. Let me know if it helped, thanks!

edu
Bronze 1
Bronze 1

Hi there, I also found this post in StackOverflow, although, there is no methos in Node client library:

https://cloud.google.com/nodejs/docs/reference/tasks/latest

Which method should I use?