# Google Calendar

This documentation provides step-by-step instructions for setting up the Google Calendar to allow for setting up meetings through the agent. For now, the only support calendar provider is Google Calendar.

### Connecting Google Calendar

Under the Calendar sidebar, you can connect to your google account calendar as shown below. And then click on Connect Calendar button on the top right

<figure><img src="/files/fni0SufPZV619VTxFk5Q" alt=""><figcaption></figcaption></figure>

After clicking there, a new tab to allow you for connecting to your google account calendar and authorize Voicehub to access it. You will be redirected to the same above page after that with ur google account selected calendar shown in the table

### Configuring Agent

All the calendar nodes are action nodes that only perform the action like scheduling, canceling or checking availability. The expected flow for those is that any data/params required for those nodes should be extracted at an earlier point through the call.

#### Schedule Event Node

This is an action node that is configured to send an invite on user's calendars based on user's input through the conversation. When adding a schedule event node, select the calendar to use for scheduling the event. This node automatically extracts information about the scheduled call details.

There are fields/variables for the call to be defined for the event scheduling as displayed in the the next screenshot. Each param can be obtained by either `Static` as fixed value, `Dynamic` whose value is automatically parsed by the agent from the conversation so far. Lastly, you can define those params as `extractedVars` where it gets extracted and can be accessed by other nodes also in the same agent. The timezone value if is set to be statically taken, can be selected from a drop down of the possible values.

<figure><img src="/files/tCwb4cif0ucz1Xrv9XCm" alt=""><figcaption></figcaption></figure>

#### Check Availability Node

This node allows for checking the availability of the calendar on specified date of the user. One thing is special about that node is that after checking the availability, it sets an extracted variable within the call that all nodes can access called `bookedEvents` containing details on the availability of the user on that specific date. The name of this variable can be updated/changed as per ur needs.

<figure><img src="/files/GsMbi1MFVO4XLZaiM9Dp" alt=""><figcaption></figcaption></figure>

#### Cancel Event Node

This node is specifically designed for allowing the users to cancel events through the conversation with the agent. It has different parameters to be used for canceling the agent. By default, it extracts a variable that contains the result of cancelling the event wheather it was canceled or not.

<figure><img src="/files/QIlpdw5OAPtnQYAiIgpT" alt=""><figcaption></figcaption></figure>

#### Best Practices

There are two ways for extracting information from the conversation that is related to those nodes.

1. Defining the event param like title as Dynamic and write a descriptive instruction to the agent on how to extract it from the conversation like the duration and guests. The caveat here is that if this value is required to be there for the meeting and in the conversation the agent did not find it, it would be skipped. If that's the case for example as date and time for calendar nodes go to the next option.
2. The other way is to actually define it as an extracted variable. For example, calendar nodes would actually require a date and time for the event to be handled. So the proper way to handle thos is by adding a default node before them that defines those as required extracted variables and in the calendar node map the params to the extracted variables as shown in the next sample.

#### Sample

Below we can see a simple agent that invokes the event scheduling node and how it can be configured with extracting the meeting details to be setup. In this sample, we are extracting title and date as variables, duration and timezone are set as static values and finally the time is extracted through a prompt were the agent reads it dynamically from the conversation.

<figure><img src="/files/lZhYZ2x3Gpgnov93X9js" alt=""><figcaption></figcaption></figure>

The meeting preparation node for example is there to extract the extracted variables as shown in the next screenshot ... it extracts variables `meetingTitle` and `meetingDate` that will be used later in the schedule event node.

<figure><img src="/files/96aMwPOvcK3CrA8dVmbU" alt=""><figcaption></figcaption></figure>

The variables extracted above are mapped to the parameters required for the calendar schedule node as displayed next

<figure><img src="/files/xjkyUU9bDbh8wiaoLwFN" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://dataqueue.gitbook.io/voicehub-docs/integrations/google-calendar-integration.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
