Skip to content
Kevin Boyd edited this page May 18, 2019 · 7 revisions

What are Actions?

Actions are methods a Bee offers you and which can get called by one of your Chains. Just like Events get triggered with a set of parameters, Actions expect you to pass a set of parameters to them.

Each Action will require different parameters. Just as an example, there's TwitterBee's tweet Action, which expects only one parameter, called status. Whatever you set this parameter to, when tweet gets called, it will post a new tweet with that value.

Referencing Event Parameters

Naturally it would be pretty boring if you could only set a fixed value for each Action parameter in your Chain. That's why you can reference all of the Event's parameters, too.

Let's say you have a Chain, which connects RSSBee's new_item Event with TwitterBee's tweet Action. In other words: whenever there's a new item added to the RSS feed, you want to post a new tweet. Let's set the tweet Action's status parameter to something meaningful:

RSS feed updated: {{.title}}

{{.title}} will get replaced by the content of the Event parameter called title. So if there's a new RSS feed item with the title Just a test, this will post a tweet with the content RSS feed updated: Just a test.

RSSBee also has access to the links in RSS feed entries. In order to access a specific array index in the .links parameter, you can use the Index action helper: {{index .links 0}}

RSS feed updated: {{.title}} {{index .links 0}}
Clone this wiki locally