Making Predictions in Zapier

Build AI-powered automations with no code.

Function provides a Zapier integration for adding AI predictions to your automations. Let's build a Zapier automation that listens for submissions to a Google form, then generates an image and emails the respondent.

Our Zapier integration is currently invite-only. Email us for access.

Adding the Form Trigger

First, create a form on Google Forms with two text fields:

  1. Email. We will use this to email the user with the generated image.
  2. Prompt. We will use this to generate an image using Stable Diffusion.

Here's the form with the two fields listed above.

Stable Diffusion predictor which we'll be using to generate an image.

Next, head over to Zapier and create a new zap. Add a Google Forms trigger by logging in to Google and connecting the form you just created:

creating a form trigger on Zapier

INCOMPLETE: User must fill in their form to generate a sample response to be used in Zapier.

Logging in to Function

First, add a Function action:

adding a Function action on Zapier

You'll need to login to your Function account. Head over to your Account page on Function to generate a new access key for Zapier:

generate access key

We strongly recommend creating a separate access key to login on Zapier, instead of reusing an existing access key.

Then in Zapier, click on "Connect a new account" then enter your access key:

logging in to Function on Zapier

Making Predictions

Now, we're all set to make predictions in Zapier. In the Function action, choose the "Predict" event then set the predictor tag:

# Set the predictor `tag`` in the `Predict` action in Zapier
@samplefxn/stable-diffusion

Once you do, Zapier will automatically fetch the input values accepted by the predictor. Simply pass in the user's prompt from their response in Google Forms:

making a prediction on Zapier

When testing the predict action, you might hit a cold start and encounter a timeout error. Simply try again in a few moments.

Using the Automation

A simple way to complete the automation is to send an email with the prediction result. You can add a Gmail action that sends an email. First, set the body type to html then populate the body:

<p>
Hey there! Here is the image you generated by filling out the Zapier + Function AI Form:
</p>
<img src="<Place the prediction result data here>" />

After publishing the zap, fill out your form:

testing out the zapier automation

And in a few moments, you should receive an email:

the zapier automation result

Previous
Predict in Discord