Quick Start - Trigger
In this guide, you will learn how to create a workflow in ByteChef and configure it with a trigger. We will walk you through the steps to add a trigger, connect it to a Google Calendar component, set up an action using the OpenAI component, publish the project, create a deployment, and monitor the workflow execution.
Note: If you are testing ByteChef locally, be sure to check out our Working with Triggers guide for detailed instructions.
Create Workflow
- Click on the three dots next to the project name where you want to add a workflow.
- Choose New Workflow from the dropdown menu.
- Provide a label for your workflow. Optionally, add a description to explain its purpose.
- Click Save to create the workflow.
Add Trigger
- Click on the pencil icon to edit the trigger.
- Find and select Google Calendar component.
- Select New or Updated Event trigger.
- Go to the Connection tab.
- Click Create Connection.
- Enter a connection name and paste the Client ID and Client Secret from Google.
- Click Next.
- Click Connect.
- Select your account.
- Click Continue.
- Select all and click Continue.
- Click on Choose Connection and select the connection you just created.
- Go to the Properties tab.
- For Calendar Identifier, select the calendar you want to monitor.
Add Action
- Click on the + button to add component.
- Find and select the OpenAI component and choose the Ask action.
- Click on the OpenAI component to open its configuration panel.
- In the Connection tab, click Create Connection.
- Enter a connection name and paste the API Token from OpenAI.
- Click Save.
- Click on Choose Connection and select the connection you just created.
- Go to the Properties tab.
- For Model, choose the desired model (e.g.,
gpt-4
). - For Role, select the appropriate role (e.g.,
user
). - For Content, enter the prompt text, such as
Desribe this event:
.
Use Data Pill
- After clicking on the content field, the Data Pill Panel will open on the left. Use the data pill to insert output from a previous component.
- Click on Google Calendar component in Data Pill Panel.
- Click on trigger_1, which is the output of the trigger for the Google Calendar component.
- Output of Google Calendar trigger is now inserted into the content field.
Publish Project and Create Deployment
- Click Publish.
- Optionally, provide a description for this published version and click Publish.
- Navigate to the Project Deployments.
- Click Create Deployment.
- Select the project you want to deploy.
- Choose the published version you want to deploy.
- Click Next.
- Turn on all workflows you want to include in the deployment.
- Setup connection for each component.
- Click Save.
- Enable the deployment. Your workflow will now run whenever a new or updated event is detected in your Google Calendar.
Monitor Workflow Execution
- Navigate to the Workflow Execution History view. Here you can see the status of your workflow executions.
- Click on an execution to see the details of each component in the workflow.
- Review the input and output of the Google Calendar trigger. Click on the OpenAI component to see the result of the Ask action.
- Click on the icon to view the entire output.
Additional Instructions
Create OAuth 2.0 Application
- Go to the Google Cloud Console.
- Click on the project dropdown in the top navigation bar.
- Click New Project.
- Enter a project name and click Create.
- Click on the project dropdown again.
- Select the project you just created.
- Go to the APIs & Services.
- Go to the OAuth consent screen.
- Click Get Started.
- Enter an App name and add user support email. Click Next.
- Select your Audience and click Next.
- Add email addresses and click Next.
- Agree to the terms and click Create.
- Go to Data Access.
- Click on Add or Remove Scopes.
- Select all necessary scopes.
- Click Update.
- Click Save.
- Go to the Clients.
- Click on Create Client.
- Click on application type dropdown.
- Choose Web application as the application type.
- Click on Add Uri.
- Enter a redirect URI, e.g.,
https://app.bytechef.io/callback
,http://127.0.0.1:5173/callback
. Click Create. - Click on the client you just created.
- Copy the Client ID and Client Secret. Use these credentials to create a connection in ByteChef.
Enable Google Calendar API
- In the Google Cloud Console, select your project.
- Go to the APIs & Services.
- Click on ENABLE APIS AND SERVICES.
- Search for “calendar” in the search bar.
- Click on Google Calendar API.
- Click Enable.
Create OpenAI Connection
- Go to the OpenAI API.
- In the left sidebar, click on API Keys.
- Click Create new secret key.
- Enter a name and select the project for the key and click Create secret key.
- Copy the API key and use it to create a connection in ByteChef.