Loading
Loading
  • Home

  • Automation with Zapier

  • Zapier tutorials

Zapier tutorials

6 min read

How to automatically write blog posts with OpenAI and Zapier

By Anna Burgess Yang · August 22, 2023
A hero image of the OpenAI app logo connected to the Google Drive app logo on a light blue background.

OpenAI can be a really powerful tool for creating content. With an unfathomable amount of data and its ability to generate output in different styles and tones, it can reduce the burden for content teams. You're not trying to generate content from beginning to end: you can take the OpenAI output and tweak it. 

The problem? OpenAI isn't really an "app." It generates content but, by itself, isn't a place for your content team to work or stay organized. The output needs to go somewhere.

Countless companies are now building their content tools on top of OpenAI's GPT. But that's adding one more tool to your team's tech stack. Instead, you can integrate OpenAI with the tools your team is already using to plan and write content. Using Zapier, you can connect systems and your existing workflow, such as your project management tool and Google Docs. 

Zapier is the leader in workflow automation—integrating with 6,000+ apps from partners like Google, Salesforce, and Microsoft. Use interfaces, data tables, and logic to build secure, automated systems for your business-critical workflows across your organization's technology stack. Learn more.

Create blog posts with OpenAI and Zapier

Zapier lets you create automated workflows called Zaps, which send your information from one app to another. You can create your own Zap from scratch without any coding knowledge, but we also offer quick templates to get you started. 

If you'd like to start with a template, click on it below, and you'll be taken to the Zap editor. You'll need to create a Zapier account if you don't already have one. Then, follow the directions below to set up your Zap.

Send a prompt to OpenAI to write a blog post when new cards are added to a list in Trello

Send a prompt to OpenAI to write a blog post when new cards are added to a list in Trello
  • Trello logo
  • Trello logo
Trello + Google Drive + OpenAI (GPT-3, DALL-E, Whisper)

This workflow requires a multi-step Zap, available on a paid Zapier plan or during a free trial. Learn more about multi-step Zaps.

We're using Trello for our project management tool and Google Docs for where we want our final drafts to go, but you can use any other project management or document tools that integrate with Zapier in this workflow.

Before you begin: Prep your project management tool

If you're trying to generate an entire blog post using OpenAI, the prompt will be everything. A bad prompt will mean more editing (or something that doesn't meet your original intent at all).

You'll want your content team to use a similar prompt format, or template, every time you send a prompt to OpenAI. You'll add the prompt to your project management tool so Zapier can pick it up and send it to OpenAI. 

Many project management tools have the ability to create templates. In Trello, for example, you can create a Template card and put the structure of your prompt in the Description. Your content team will fill in the blanks for each piece of content. 

A card in Trello that shows a template outline for a blog post.

You can also create custom fields within your project management tool for things like "Audience" and "Tone." This will further guide your prompt in OpenAI. 

Custom fields in Trello for audience, tone, keywords, and draft.

Project management tools usually have the ability to add an assigned person for the task and due date. Go ahead and add these, once known. Even though you don't need them for the OpenAI prompting, specifically, you can still use this info within Zapier (plus, you probably need it for your project management anyway). 

A card in Trello with an assigned member and due date.

Add a separate list for AI content

No matter what project management tool you use, you need a way to indicate that the content is ready to be drafted in OpenAI for two reasons: 

  1. This will be the trigger Zapier needs to run your prompt.

  2. Not all of your content may go through OpenAI (such as video content or a case study).

You need a way to distinguish that this item on your content list should be sent to OpenAI. 

In Trello, you can create a separate list called "AI Content." Moving content to this list will be the trigger for Zapier. You could also use a tag, label, or other indicator depending on your project management tool. 

A Trello board that shows a list for planned content and a list for AI content.

Set up your Trello trigger step

Now you're ready to set up your Zap. In our example, we'll select Trello as our trigger app and Card Moved to List for our trigger event.

A trigger step in the Zap editor with Trello selected for the trigger app and Card Moved to List for the trigger event.

Next, select which list you want Trello to watch for new cards. This should be the list you created specifically for AI content.

A field in the Zap editor for a Trello list with AI Content selected in the field.

Finally, test your trigger step. The information collected in this test will be used to set up the rest of your Zap. Once your test is run successfully, click Continue to move on to your first action step.

Send the Open AI prompt

Now it's time to set up your action step to send your prompt from Trello to OpenAI.

Note: For this step to work correctly, you need to make sure your OpenAI prompt is filled out in your project management tool before you move it to your list in Trello. Once you move the card to the list you've selected in the previous step, your OpenAI prompt will be sent by Zapier. 

Select OpenAI for your action app and Send prompt for your action event.

An action step in the Zap editor with OpenAI selected for the action app and Send Prompt selected for the action event.

You can change the default settings for the following fields, if you like, but we'll keep them as is: Model, Temperature, Top P, Frequency Penalty, and Presence Penalty.

Now it's time to set up the Prompt field, which will tell OpenAI the information it needs to write the blog post. My completed prompt in Trello's Description field looks like this:

A filled out prompt card in Trello.

In this example, in addition to adding the description (which contains my prompt), I also added context using my custom Trello fields to identify the keywords, audience, and tone. To add these and other data from your previous Trello step, just click in the Prompt field and select them from the Insert Data dropdown.

The prompt field in the Zap editor with a prompt and data from the previous Trello step added to the field.

Once you're finishing setting up your prompt, test your action step and add an additional step to your Zap.

Send the OpenAI output to a Google Doc

Your previous OpenAI action step generated a blog post based on your prompt, but now you need to send that output back to where you want to edit that blog post, such as Google Docs.

Select Google Docs for your action app and Create File from Text for your action event.

An action step in the Zap editor with Google Drive selected for the action app and Create File from Text for the action event.

Select the correct folder in your Google Drive for proper organization.

A drive and folder selected in fields in an action step in the Zap editor.

Add the text output from your OpenAI step and any fields from Trello you'd like to include to the File Content field to add them to the body copy of your Google Doc. In this example, I'm also using the Card Name from Trello as my document name and adding the assigned writer to the document's text.

Data from previous Trello and OpenAI steps have been added to the File Name and File Content fields.

You'll want to select True for Convert to Document so that the file is added as a Google Doc rather than a text file. 

Once you're done customizing your fields, test your action step. This will create a new Google Doc with your written draft in the Google Drive folder you selected. Here's what the draft looks like in our example:

A blog post written by OpenAI.

Once everything looks right, you're ready to add your final step to your Zap.

Add the Google Doc link back to your project management tool 

To close the loop on your content creation workflow, you should add the created Google Doc link back to your project management tool. That way, it's an easy click from your project management tool over to the Google Doc to see the AI output (and the final, edited result). 

In Trello, I made sure to add a custom field for the Google Doc link. 

Add a final action step to your Zap and select Trello for your action app and Update Card for your action event.

An action step with Trello selected for the action app and Update Card for the action event.

Click in the Card field, click on the Custom tab, then select the Card Id from your first step in Zapier.

A data dropdown menu is shown open in the Card field with Card ID selected from the dropdown.

Finally, click in the Draft Link field (or whatever you named your custom field in Trello) and add the Alternate Link from your Google Doc step, which contains the full URL. 

A link added to the Draft Link field from the previous Google Drive step.

You don't need to update any other fields in this Trello step. Just test your final action step and you should see your draft link in your project management tool.

A link to the Google Doc with the blog post has been added to the Draft field in Trello.

Once everything looks right, you're now ready to use your Zap.

Play with OpenAI prompt flexibility 

One of the great things about OpenAI is its flexibility. You could add multiple lists in Trello to use with OpenAI, such as a list that starts with brainstorming ideas. Instead of writing the OpenAI output to Google Docs, you could write it back to the Trello card to review and refine before moving the card to the drafting stage. You could also use the text in the Google Doc as a prompt to ask OpenAI to propose alternate intros or conclusions. 

But any of these options keep your project management tool at the heart of your workflow. By doing this, you'll know what content is ready for AI, in the editing stage, or ready to publish. 

Related reading:

Get productivity tips delivered straight to your inbox

We’ll email you 1-3 times per week—and never share your information.

tags

Related articles

Improve your productivity automatically. Use Zapier to get your apps working together.

Sign up
A Zap with the trigger 'When I get a new lead from Facebook,' and the action 'Notify my team in Slack'