Why am I getting an error when setting up a trigger in Slack?

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

Hey I’m getting this error when attempting to setup a trigger. Any thoughts?
logs

executionsProps are  {
  externalUserId: 128,
  actionId: 'slack-new-user-mention',
  configuredProps: {
    slack: { authProvisionId: 'apn_V1hjDyg' },
    conversations: [ 'C08Q087RLCD' ],
    user: 'U08QQUN3FDE',
    db: '$.service.db',
    slackApphook: '$.interface.apphook',
    keyword: null,
    ignoreBot: null
  }
}
resp is  {
  os: [
    {
      k: 'console.log',
      msg: 'Ignoring event with unexpected type "undefined"',
      ts: 1747895490616
    }
  ]
}

code:

try {
        const isSource = false;
        const dynamicId = dynamicIds.length > 0 ? dynamicIds[0] : null
        console.log("dynamicId is ", dynamicId)
        const executionsProps: any = {
            externalUserId: external_user_id,
            actionId: key,
            configuredProps: {
                ...props,
                ...properlyConfiguredProps
            }
        }
        if (dynamicId) {
            executionsProps.dynamicPropsId = dynamicId
        }
        console.log("executionsProps are ", executionsProps)
        let resp: any

        if (isSource) {
            const { data: deployedTrigger } = await pd.deployTrigger(executionsProps)
            resp = {
                triggerId: deployedTrigger.id,
            }
        } else { 
            resp = await pd.runAction(executionsProps)
        }
        console.log("resp is ", resp)
        res.status(200).json(resp)

My first l guess would be that externalUserId should be a string and not an int?

Even when setting external_user_id to a string it’s the same issue

Hm, can you try in the demo app? You can compare the payloads we’re sending from there if you open the network panel.

Actually I just realized my code path was not calling deployTrigger but was instead calling the execute run

I’ve fixed that and now i’m getting the error:

error is  Error: HTTP error! status: 404, body: {"error":"record not found"}
    at O.makeRequest (file:///Users/victor/Documents/apps/repo-name/node_modules/@pipedream/sdk/dist/chunk-QTZ54CP7.js:1:2392)

Seems like something is off in the payload or the SDK method – I’d compare the payloads using the demo app, like I mentioned above.

Got it – I see the difference. I’ll be back with some questions to help me understand certain special types

$.interface.apphook – I assumed like “$.interface.db” I could just pass this type back as the value but it looks like if there are remote, you need to pass a valid one back?

Yeah how do you handle “remote” versus “remoteOptions”?

Handling remoteOptions is straighforward but this is the first time i’m seeing remote

I also don’t see remote in any of the current documentation

Oh interesting – in the working example, the $ fields are basically ignored

including app hook. So I guess i’ll just update our system to ignore them

Can you clarify what you’re referring to re: remote vs remoteOptions?

including app hook. So I guess i’ll just update our system to ignore them
Yes, sorry, we need better docs on this :pray::skin-tone-2:

    {
        "name": "slackApphook",
        "type": "$.interface.apphook",
        "appProp": "slack",
        "remote": true
      },

versus

      {
        "name": "user",
        "type": "string",
        "label": "User",
        "description": "Select a user",
        "remoteOptions": true
      },

No sweat, our system is pretty complicated so I knew we’d discover edge cases as we built