This topic was automatically generated from Slack. You can find the original thread here.
Hi , I have a couple quick questions RE: Custom Sources $.emit
> namestringoptional The name of the “channel” you’d like to emit the event to. By default, events are emitted to the default channel. If you set a different channel here, listening sources or workflows can subscribe to events on this channel, running the source or workflow only on events emitted to that channel.
> summarystringoptional Define a summary to customize the data displayed in the events list to help differentiate events at a glance
How/where can a workflow select the channel to subscribe to? I didn’t see this in the trigger UI. Is there additional config required (I’m editing an HTTP source)
What’s a “listening source”? I haven’t seen this in the docs yet…
I’m setting summary but I don’t see it appear in the list of events on the Source page. Where can it be viewed?
The part you refer to is called Subscriptions, here is the link for the docs
When emitting an event using this.$emit(event, metadata), the metadata parameter is a object that should contain id - any string/number (for deduplication), summary is any string, ts is the timestamp, i.e. new Date(event.date) . So it should look something like this:
Let me try to understand, you have one webhook that receives all 4 Slack payload types for interactivity and you want to send each type to a workflow specific for that type?
> The other issue I hit is that the ack response from the pipedream source needs to be sent within 3 seconds but this doesn’t always work.
Oh, so this is causing duplicated webhook events?
> Let me try to understand, you have one webhook that receives all 4 Slack payload types for interactivity and you want to send each type to a workflow specific for that type?
Exactly.
> Oh, so this is causing duplicated webhook events?
No, the slack docs aren’t great but the key timing constraints are:
(1) HTTP response with 200 Ok within 3 seconds.
> All apps must, as a minimum, acknowledge the receipt of a valid interaction payload.
> To do that, your app must reply to the HTTP POST request with an HTTP 200 OK response. This must be sent within 3 seconds of receiving the payload. If your app doesn’t do that, the Slack user who interacted with the app will see an error message. Make sure your app responds quickly.
In some of my early tests, I struggled to achieve this. I know that sometimes workflows take up to 8 seconds extra (presumably lambda cold starts). Not sure where to measure the Source HTTP response times but I did assume some intermittent silent failures are down to this constraint (they might not be.)
(2) publish to a response_url
Can be done up to 5 times within 30 minutes. This is the job of the workflow.
Using Pipedream Subscriptions - cleaner, but harder.
Using an HTTP source for each the 4 specific payloads workflows, and one workflow with a Slack trigger and a custom Node step that has an if/else that checks for the payload type and sends to the according HTTP endpoint - easier
I’m guessing it would be the same for both, since I think each triggered event counts as one invocation.
But or @U02A06JPKEH will probably know the exact answer, can one of you help please when you get online?