How Can I Correctly Propagate External User IDs in Pipedream Connect Workflow's Event.Context?

This topic was automatically generated from Slack. You can find the original thread here.

Hi everyone, I need some help with Pipedream Connect and external user IDs.
I’m trying to deploy a trigger programmatically and associate it with an external user. I’ve run into an issue where the external_user_id never seems to propagate into the workflow’s event.context. Here’s what I’ve tried so far:

  1. Using webhook_url
    • I deployed the trigger with the workflow’s unique url as the webhook_url.
    • When the external event fires, the request does reach the workflow and it executes.
    Problem: event.context.external_user_id is always null.
    • I also tried sending the external user ID in headers during deploy, but it still stays null.
  2. Using workflow_id
    • I switched to deploying the trigger with workflow_id instead of webhook_url.
    • This time, the trigger deploys fine, but when the event fires, the workflow never runs at all — the request doesn’t even seem to reach the workflow.
    • I’m guessing I may be misunderstanding how to route events when using workflow_id (e.g. should I be calling the trigger URL returned from the deploy response instead of the workflow run URL?).
    My deploy code
    Here’s the snippet I’m using:

const response = await [axios.post](http://axios.post)(
  `https://api.pipedream.com/v1/connect/${process.env.PIPEDREAM_PROJECT_ID}/triggers/deploy`,
  {
    id: componentId,
    external_user_id: userId,
    configured_props: configuredProps,
    // Tried both webhook_url and workflow_id here
    webhook_url: "https://secret.m.pipedream.net"
    // workflow_id: workflow.id
  },
  {
    headers: {
      Authorization: `Bearer ${accessToken}`,
      "x-pd-environment": process.env.PIPEDREAM_PROJECT_ENVIRONMENT,
      "Content-Type": "application/json",
    },
  }
);

What I expected
• When using external_user_id in the deploy payload, I expected the workflow executions to include that user ID in event.context.external_user_id.
• I’ve followed the docs and the community thread here
• , but I’m still stuck.
Has anyone else run into this mismatch where webhook_url works but drops the external user, while workflow_id doesn’t trigger the workflow at all?

Any insights, examples, or working code snippets would be hugely appreciated!

Sounds like you should use workflow_id and not webhook_url

webhook_url is when your system is external to Pipedream and you want the trigger to trigger it

But it’s odd that your workflow is not being triggered, is your source emitting events?

Oh and the external_user_id won’t be present in the workflow trigger context, it will be injected automatically into the steps that are enabled to use external user auth

The problem is that when i deploy a trigger using REST api with webhook url, it is deployed and when a trigger event happens it also triggers the workflow associated but the workflow requires external_user_id to run, but in the context extenal_user_id is null every time.

When i send workflow_id in payload instead of webhook_url , the trigger is still deploying but it never triggers the workflow on trigger event

The problem is that when i deploy a trigger using REST api with webhook url, it is deployed and when a trigger event happens it also triggers the workflow associated but the workflow requires external_user_id to run, but in the context extenal_user_id is null every time.
Correct, but that is not the way it is intended to be used. Although we have received requests for sending the extenal_user_id in the trigger payload

cc ^^^

When i send workflow_id in payload instead of webhook_url , the trigger is still deploying but it never triggers the workflow on trigger event
What is the payload you’re sending to deploy the trigger?

{
    id: componentId,
    external_user_id: userId,
    configured_props: configuredProps,
    // Tried both webhook_url and workflow_id here
    webhook_url: "https://secret.m.pipedream.net"
    // workflow_id: workflow.id
},

Hmm looks correct. What is your workflow ID? So I can take a look at it

Here it is p_ZJCPaAB

Also if this is not the intended way, what is?

Using the HTTP webhook URL in Pipedream as webhook_url is not the intended way

It’s intended for external services (like your server)

To run workflows, the intended way is to use workflow_id

I followed the docs,

Ok so at your workflow, there are incoming events, but they get this error:

PD Connect Error
No external user ID passed, but one or more steps require it. Refer to https://pipedream.com/docs/connect/workflows#invoke-the-workflow for more info.

Exactly!