Unable to see SendGrid Email Template Connector in C8

i am following SendGrid Connector | Camunda 8 Docs,
however unable to see “Unable to see SendGrid Email Template” within the available connectors.
I do see ’ SendGrid outbound Connector. am i missing anything here?

Hi @Rajeev_Lochan_Subs - that’s the right Connector. I agree that the docs are a little confusing in the naming here. I will see how we can clarify that!

image

@nathan.loding : Thanks for your prompt response!
I am trying to call sendgrid module (BPMN) from postman using webhook explained Start a Camunda Platform 8 Process via REST with Webhooks | Camunda

Questions/Issues:

  1. My postman return 200 OK status with no response. should i expect in postman response?
  2. Error received in my process which is very vague:
    "User request failed to execute with status 400 and error 'SendGrid returned the following errors: Cannot use dynamic template data with a legacy template ID; The template_id must be a valid GUID, you provided ’
Summary

14dd43b60ba94773b26c2d30bf1454a6

‘.; The subject is required. You can get around this requirement if you use a template with a subject defined or if every personalization has a subject defined.; Unless a valid template_id is provided, the content parameter is required. There must be at least one defined content block. We typically suggest both text/plain and text/html blocks are included, but only one block is required.’"

Hi @Rajeev_Lochan_Subs - the webhook response when calling an inbound webhook connector is expected to be empty by default. You can configure a response body expression to return data if you need.

The second question is not related to Camunda. That is a SendGrid error, and it has been many, many years since I personally used SendGrid, so I am not sure. I would check their documentation about dynamic vs legacy template IDs.

Thanks @nathan.loding !
I am still not able to figure out a way to receive output from webhook.
Lets say with this example here Start a Camunda Platform 8 Process via REST with Webhooks | Camunda
i want to retrieve location as response body. what setting am i supposed to do?
I tried following configuration at webhook “response body expression”
{ location : response.body }

Hi @Rajeev_Lochan_Subs - I’m not sure what happens if you set the response body expression to ={ location: response.body }, because response.body isn’t defined at that point. You are defining the response body in this step.

Where is the location value coming from?

My Objective is to retrieve ‘fishingLocations’ that was set in DMN as described here https://camunda.com/blog/2023/05/start-camunda-8-process-rest-webhooks/?_gl=1*1djzg7i*_ga*MTY3NDcyNjQyMS4xNzA1MDk0NzUy*_ga_4EYN8X5FNR*MTcwNTk0NDQ0MC4xNy4xLjE3MDU5NTI0MzUuNjAuMC4w
i tried different ways to populate fishingLocations like:
{ location : response.body.fishingLocations }
any idea on how should i populate fishingLocations in Postman response?

@Rajeev_Lochan_Subs - there is no response variable, you need to define what the response should contain. If you followed that blog post, the DMN is outputting a variable named fishingLocations. That means the variable fishingLocations is available in your process, and you can use it in FEEL: ={ locations: fishingLocations }. Following the example in the blog, which return two locations, your webhook call should receive a response body of { locations: ["river", "supermarket"] }.

Yes, I am able to see ‘fishingLocations’ in Camunda Operate as Variables. However, it is coming ‘null’ in postman response even after adding { locations: fishingLocations } At response body expression

@Rajeev_Lochan_Subs - can you share your BPMN XML? (You are able to export it in Modeler.)

where-to-fish.dmn (3.2 KB)
catchfish.bpmn (5.6 KB)
Postman Request->
{
“status”:“OK”,
“fish”:“Bass”
}

Response recieved:
{
“locations”: null
}

@nathan.loding : Thanks for your help! Added

@Rajeev_Lochan_Subs - thanks for the sharing the model, I see the confusion! Processes always move forward. When you initiate the HTTP request to your webhook, the webhook returns when it completes, and it completes when the process starts. Then Zeebe moves to the next step, which is the business rule task. The webhook does not wait for subsequent tasks to complete before returning a value. You need to add a second webhook after the location has been determined, which returns ={ locations: fishingLocations } as the response body. Breaking it down slightly further:

  1. You make an HTTP request to your webhook
  2. Internally, Operate receives the request and starts the process
  3. Seeing the process is successfully started, the webhook is now complete and returns to your client (Postman, in this case)
  4. Zeebe moves to the next step in the process: the business rule task
  5. Once the DMN is complete, Zeebe moves to the next step, which is the end of the process.

You need to insert a Step #6 with another webhook connector that you can call to retrieve the information. (This is one pattern, at least; there are other ways to manage data with processes.)

Hope that helps!

Thanks for your time in sharing this method!
I inserted another webhooks at the end node (Step # 6) with attached screenshot settings.


Execution:

  1. I executed first webhook and i see process is running and control is at ‘Inbound’ webhook
  2. I executed inbound webhook URL but i don’t see any movement in ‘Operate’.Screenshot attached. I also visited your post to learn more on

Hi @Rajeev_Lochan_Subs - you’re very close. I believe the issue is that your correlation key is not correct. When you send a request to the second webhook, you don’t know the value of fishingLocations; however, by setting the “Correlation key (process)” value to =fishingLocations, Zeebe assumes you already have that information.

The correlation key is what matches an incoming request to a running process. It should be a value unique to that process instance. You can read more about them here.

To keep it simple, I would recommend sending a unique value when you start the process. For instance, in the body of that request, you could add a value for fishersName: "Unique Name" or fisherId: 123. (Make sure you map that variable to a process variable. In “Result expression” you can do something like ={ fisherId: request.body.fisherId }). Change the correlation key expressions in the second webhook to match (=fisherId and =request.body.fisherId). Finally, make sure the body of your second webhook request includes the property fisherId with the same value you started the process with.

Hopefully that made sense!

Not sure what am i missing now. Added BPMN for your review please. I can see my correlation key is correct in ‘Operate’.
Looks like my Inbound (Second) Webhook is not able to pickup the value from correlation key

  1. Payload for first webhook: {
    “status”:“OK”,
    “fish”:“Bass”,
    “fisherId”: “123” }
  2. Payload for inbound second webhook: { “fisherId”: “123” }
    I also tried with { “status”:“OK”, “fish”:“Bass”, “fisherId”: “123” }
    Response is blank with 200 status. No movement in “Operate”
    catchfish.bpmn (8.8 KB)

Hi @Rajeev_Lochan_Subs - couple follow up questions … is your cluster on version 8.4? If not, try to update the cluster to 8.4 and try again. New in 8.4 is more logging on the “Webhooks” tab in Modeler. When you open that tab in Modeler with your second webhook element selected, what information do you see?

Yes @nathan.loding . My Cluster is on 8.4.
Do you mean to say opening third Tab in Modeler (i.e. Webhook)? I see below details.

Last activities
POST
2024-01-29 15:56:21

On a different note: I also tried without webhooks. Simply calling REST API for mention here https://jfk-1.operate.camunda.io/fb207bbc-776e-40dc-8b12-b877f1430f71/v1/process-definitions/search
Even this API (POST) call is not giving me the right results.
is there a simple way to call this BPMN (Something like …/v1/running-Process-Details/FishingExample) and returns me below response
{
“location”: “xyz”
}

@Rajeev_Lochan_Subs - and just to double check, you are seeing that activity for your second webhook? Each webhook has a unique URL, and I want to make sure that each Postman request is going to the correct URL. Eliminate possible issues one by one!

I’m not sure what you’re asking regarding the REST API. Operate has a REST API that can be used to list running processes, list deployed process definitions, retrieve the BPMN XML, things like that. Zeebe, the workflow engine, has a gRPC API that allows you to control aspects of your process, but it’s not a replacement for the webhook. You can find them all documented here.