Triggers
Introduction

With FeedHive's automation feature, we can build advanced, custom workflows that integrates with the many automation services out there.

In this article, we will learn how to set up a trigger.

What is a trigger?

A trigger is a URL that we can call in order to make FeedHive do something.
This is also known as an API endpoint - in FeedHive, we simply call this a Trigger URL.

When setting up a trigger, we can pre-configure FeedHive to take certain actions which will happen when we call the URL that FeedHive creates for us.

Let's take a look at which actions we can make FeedHive take.

Publish a draft

Let's set up a trigger to publish a draft that we have already created.

The first thing we'll do, is to create a new draft.
Let's do that by writing a post on the Compose page, but without scheduling it.

Next, let's go to the Automation page and create a new Trigger.

FeedHive will create a draft trigger for us.Under "Trigger URL", you can see that FeedHive already created the URL we will be using.

We want to pick Publish draft under the field "What happens when triggered?"
Then we click Select a draft under the field "Which draft should be published".

Once you have selected the draft you created, you will see a draft preview on the right side.
Finally, click "Save & Publish" to publish this trigger.

Now you can use the Trigger URL in any workflow service that allows sending POST requests (recommended) or GET requests (for backwards compatibility) - or you can incorporate it into a custom workflow that you have developed yourself.

Here is an example of how you can use it with Zapier using the POST method:

When configuring the webhook in Zapier:

  • Method: POST
  • Content Type: application/json
  • Request Body:
{
  "scheduled": "2024-01-15T10:00:00Z"
}

This will publish your draft at the specified time when a Zapier run is triggered by some event.

Create a draft

Next, let's set up a trigger to create a new draft from scratch.

A draft from scratch

Just like before, we go to the Automation page and create a new Trigger.
This time, we will pick Create draft under "What happens when triggered".

When we use this setting, we also get the option to pick a label and choose which social accounts should be selected for this draft.

Notice the Trigger URL that FeedHive created for you. You can now send POST requests to this URL with the post content and other variables.

You can pass the post text and other variables in the request body as JSON when using the POST method (recommended).

In the example above, we're using Zapier to react to a new to-do item created in the app Any.do. Configure the webhook with:

  • Method: POST
  • Content Type: application/json
  • Request Body:
{
  "text": "{{todo_title}}"
}

This will call the FeedHive trigger and use the title of the to-do item as the text of the draft.

Of course, this is just one example.
The options are almost endless.

A draft using a template

Sometimes adding the entire text through the text query parameter gets a bit tedious and repetitive.
Fortunately, FeedHive also allows you to use a post template, which can contain images, video and inline Trigger Variables as well.

Go the Assets → User Templates and let's create a new template.

Notice that we are using 3 Trigger Variables in this template: title-of-blogpost, excerpt-of-blogpost, and link-to-blogpost.

A variable can be anything you want, all you need to do is to wrap it in two square brackets: [[name-of-variable]].
When you're done, click Create to save this template.

Now, let's go back to the Automation page and set up a new trigger.
This time, we pick a template under the field "Pick a post template".

Notice that the Trigger URL is ready for use. The variables from your template can now be passed in the request body when using the POST method.

You can now use this trigger to automatically create a new draft every time a blog post is published.

For instance, we could use Zapier to listen to an RSS feed and automatically create a draft when a new blog post is live.

Configure the webhook with:

  • Method: POST
  • Content Type: application/json
  • Request Body:
{
  "title-of-blogpost": "{{rss_title}}",
  "excerpt-of-blogpost": "{{rss_description}}",
  "link-to-blogpost": "{{rss_link}}"
}

When this Zapier runs, a draft will be created in FeedHive, and all the variables will be substituted with the values from the request body.

Writing with AI

When creating a draft or publishing a post with a trigger, you can leverage FeedHive's AI capabilities to generate content automatically.

If you select an AI model under the "Write your post with AI" field (such as GPT-4.1), your trigger becomes an AI trigger. This changes how you send data to the trigger.

Using the prompt field

Instead of sending the post content in the text field, an AI trigger expects a prompt field. FeedHive will use this prompt to generate the post content using your selected AI model.

For example, when using the POST method, your request body would look like this:

{
  "prompt": "Create a post about the benefits of morning exercise",
  "media_urls": "https://example.com/workout-image.jpg"
}

Create and publish a post

Finally, you can also create and publish a post directly using a Trigger.
For this, pick Create & Publish post under the "What happens when triggered?" field.

This works in exactly the same way as with a draft.
The main difference is that this post will be created and then scheduled to go out immediately (or at the time specified in the scheduled variable).

Example POST request body:

{
  "text": "Check out our latest blog post!",
  "scheduled": "2024-01-15T14:30:00Z",
  "media_urls": ["https://example.com/featured-image.jpg"]
}

Other examples

Check out how Pete uses FeedHive Triggers and Make to sync draft posts between FeedHive and a Google Sheet document.

FAQ‍

  • Can I use triggers with Zapier directly? Without having to use webhooks?
    Not at this moment. But we are working on integrations with a lot of services - Zapier, Airtable, Pabbly (just to name a few). These will be available as so-called "Recipes". For now, you can use Zapier's webhook action to send POST requests to your trigger URL.

  • Should I use POST or GET method?
    We recommend using the POST method with JSON in the request body as it's more flexible and doesn't have URL length limitations. The GET method is still supported for backwards compatibility.

  • Can I use FeedHive automation the other way around? Have FeedHive call a webhook when something happens, e.g. a post has published.
    Yes. These are called Notifications and work in reverse.