How Can I Find the Link Between the Deployed Trigger and Trigger Key in Pipedream?

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

Hi! I’m playing around with Triggers, and I’m looking for a way to find the link between the Deployed Trigger and the trigger key.

Request

curl --location --request GET 'https://api.pipedream.com/v1/connect/<proj_id>/deployed-triggers/<trigger_id>?external_user_id=<user_id>' \
--header 'X-PD-Environment: development' \
--header 'Authorization: Bearer ...'

Response

{
    "data": {
        "id": "...",
        "owner_id": "...",
        "component_id": "sc_WGiNNvN1",
        "configurable_props": [
            {
                "name": "googleSheets",
                "type": "app",
                "app": "google_sheets"
            },
            {
                "name": "db",
                "type": "$.service.db"
            },
            {
                "name": "http",
                "type": "$.interface.http"
            },
            {
                "name": "timer",
                "label": "Push notification renewal schedule",
                "description": "The Google Drive API requires occasionally renewal of push notification subscriptions. ****This runs in the background, so you should not need to modify this schedule****.",
                "type": "$.interface.timer",
                "static": {
                    "intervalSeconds": 82080
                }
            },
            {
                "name": "watchedDrive",
                "type": "string",
                "label": "Drive",
                "description": "Defaults to My Drive. To select a [Shared Drive](https://support.google.com/a/users/answer/9310351) instead, select it from this list.",
                "optional": true,
                "default": "My Drive",
                "remoteOptions": true
            },
            {
                "name": "sheetID",
                "type": "string",
                "label": "Spreadsheet ID",
                "description": "Select a spreadsheet or provide a spreadsheet ID",
                "useQuery": true,
                "remoteOptions": true
            },
            {
                "name": "worksheetIDs",
                "type": "string[]",
                "label": "Worksheet ID(s)",
                "description": "Select one or more worksheet(s), or provide an array of worksheet IDs.",
                "remoteOptions": true
            }
        ],
        "configured_props": { ... },
        "active": true,
        "created_at": 1751551804,
        "updated_at": 1751551804,
        "name": "...",
        "name_slug": "..."
    }
}

If I go to https://pipedream.com/sources/<trigger_id> , I do visually see the trigger name, so there is a link somewhere, but I’m having a hard time finding the way to do that. I do see a component_id in the response, but querying https://api.pipedream.com/v1/connect/<proj_id>/triggers/sc_WGiNNvN1 gives me a 404.

Is there any way to get this information? Otherwise I’d need to also store it on our side, which ofc isn’t the worst, but I like it more when things can’t get out of sync ever :slightly_smiling_face:

You’re saying you want to know dcid_xxxxxxx → trigger key, like slack-new-message-received for example?

Yes exactly. We’ll have multiple non-technical users set up multiple triggers, and I’m building a triaging system to select which of their workflows to kick off (as mostly they’re expecting only the ‘right’ one to be selected cause they’re non-technical so they don’t understand how any triggering stuff works). If I can abstract all of that complicated stuff away from them, then they’ll be happy and we’ll be happy, but that’s quite difficult if every deployed trigger gets a new ID (indeed like dc_XXXXXXX) and doesn’t get the trigger_key (indeed like google_sheets-new-row-added)

Cause if I can group by trigger key, then I can easily do the triaging (and easily not even deploy a new trigger for a different workflow, and just attach the existing trigger too. But currently our backend / db only knows dc_XXXXXXX, and has no way to translate that back

I see, yea none of the current endpoints appear to return the trigger key, that’s too bad. Probably the easiest thing in the interim is to create that mapping on triggerDeploy, since you’ll know what trigger key you’re deploying, and the dcid is returned in that response.

Sad, would be great if that’d be easier. But we’ll store it on our side for now then. Thanks!

Do you see any non-horrible way to backfill the ±50 triggers we have deployed currently? I’m currently looking at spending a lot of time manually filling out https://pipedream.com/sources/<trigger_id> with all our existing triggers and then trying to convert the name I see there back into the trigger key, but would love it if I didn’t have to do that

Yea, sorry about that. The use case makes total sense. If you DM me the list trigger IDs you have no I can probably look it up for you for a one-time backfill.