Can I access the event emitted by the source without passing it as a prop?

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

Rob Pitt : Hiya! Thanks for Pipedream it’s been a lot of fun tinkering these past few days. Anyway I’ve got a probably fairly simple question. I’ve developed a component of the type “action” which needs to access the current event. What I’ve done is made event a prop then evaluated {{ steps.trigger.event }} in the properties configuration of the step in the workflow. Can I access the event emitted by the source from the action in a way that doesn’t require that? Thank you!

Sergio Rodriguez : mmm. you can define a parameter In your code param.step and then pipedream will generate a textbox for you to set that value, there you can set to {{steps.trigger.event}}, but in your code you will be accessing param.step. this is sort of the trivial answer, and posting it just in case is helpful.

Dylan Sather (Pipedream) : Welcome !

That is exactly how you should be referencing the event data. We don’t expose event data to the action directly by design, since actions can be used across triggers, and since the user can even rename the trigger step. So all input must be passed as props.

What Sergio’s referencing is a part of our v1 actions (our API prior to component actions).

Dylan Sather (Pipedream) : If you’re writing Node.js code steps within a step, and not developing a component action, you may have seen that you have direct access to steps.trigger and its associated event data.

Rob Pitt : Brilliant. Thank you. It felt like a workaround but if it’s by design, that’s all good. Is it possible to delete a published action? I can’t find a way.

Dylan Sather (Pipedream) : Not right now (tracking here), but if you DM me the key of that component and your Pipedream username, I can take care of it for you.

Rob Pitt : Okay thanks. I don’t need to do it quite yet I’m just about to merge two actions so one will become obsolete. When it does I’ll do that.