Retrieve extra query parameters that were passed when calling a Workflow

Continuing the discussion from How to read GET params in Webhooks when using Workflows

and

Continuing the disscussion from Is it possible to pass in data to a webhook using query parameters?

Roadblock

I want to be able to let my users configure how their webhook will work for them.

Problem

The service I am using to send the webhook payload offer ZERO configuration besides the URL. I cannot add headers. I cannot add to the payload it sends....

Idea

Since internally you are already parsing the query string, looking for workflowApiKey then why not attach the rest of the query string for us to use? maybe stick it on workflowContext.queryString?

Example

I made a small app that lets a user pick from Monday.com, a workspace -> board -> section.

This assembles the webhook url something akin to this:
https://ORG.retool.com/url/MY_WEBHOOK_ID?workspace_id=1234&board_id=5678&section_label=inbox&workflowApiKey=PUT_KEY_HERE

Then in the workflow...

  • Branch block - Check if it exists to fail fast
    • typeof workflowContext.queryString['board_id'] === "string"
      
  • Code Block - Utilize the query parameters to change your code's behavior
    • const result = fetchSomethingFromMonday(url_here, { 
          boardId: workflowContext.queryString['board_id']
      };
      

My Dream

I would like my users to make their own webhook URLs. I don't want to have to make tailored workflows for each different workspace -> board -> section a user might want.

My user would be able to copy their custom webhook URL so when they put it in the service they are using, it will be setup correctly with no intervention from me.

Wow... ignore me!!! This is already implemented :slight_smile:

urlParams1

Editing to add that it is located on startTrigger and that I was only able to see it after I had my service do a test send and I checked the workflow logs.
urlParams2

Also, it does not get hinted which is maybe why I missed it
nohint

2 Likes