# Creating a Story Skill in Google Assistant

Photo by [Thomas Kolnowski](https://unsplash.com/@tkolnowski?utm_source=medium&utm_medium=referral) on [Unsplash](https://unsplash.com?utm_source=medium&utm_medium=referral)

Hi, we will see how to create a storytelling action in google assistant using dialog flow and firebase.

We will split this blog into two parts

Part 1: Create an action in google assistant and adding dialog flow

Part 2: Creating a Firebase cloud function which acts as a webhook and link the webhook with dialog flow

**Let's begin with Part 1 now**

Create a Project in [Google Assistant Developer Console](https://developers.google.com/actions/)

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1698055590068/f0471741-63f5-4e3a-97a0-331e4d94c904.jpeg)

Then fill the project name

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1698055591674/0857533f-1ffe-41bf-8811-5b09ba7a40ca.jpeg)

Once Saved Click Actions

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1698055593065/fec284fc-1080-41ae-bf4d-db8000055b9f.jpeg)

Which will show the actions screens

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1698055594463/b398af8c-82f0-4f40-9cdb-4e609ad0ccac.jpeg)

Select Add Action option

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1698055595752/79faa09b-f4e7-4a85-86c5-e0a4a6bf87cd.jpeg)

A popup would be opened in that select Custom intent and then click Build which will open the dialog flow

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1698055597234/5a076928-0574-424b-8ab6-8546c73fd547.jpeg)

Click on Default Welcome intent

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1698055599445/ca3852d6-9904-4eeb-a2d1-8d37f7d3a9ea.jpeg)

Remove the prefilled text responses and then type a new response like

Hi ! Welcome to Cartoon Stories

and then enable the webhook for the welcome intent

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1698055601154/2b268188-933e-4bba-8d25-1af257c4b47c.jpeg)

and then click save (the intent gets saved). We will handle the welcome intent in the backend using firebase cloud functions.

Similarly, create intents like

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1698055602775/8c88fcb8-9c5f-436a-9898-5ddb5b8e5d16.png)

1\. For **actions\_intent\_CANCEL** add the text response as

Comeback again i will think more stories for you

and enable the end of the conversation and click Save

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1698055604233/319cf725-27b0-48c6-b0d4-ddb1b451fee3.jpeg)

2\. For **actions\_intent\_MEDIA\_STATUS** add the follow-up intent by clicking the Add-followup-intent

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1698055605746/99bb8ee7-485f-46c4-b4f5-650ce060379b.png)

for **actions\_intent\_MEDIA\_STATUS** and **actions\_intent\_MEDIA\_STATUS-yes** enable the webhook and save the intent.

for **actions\_intent\_MEDIA\_STATUS\_no** add the text response as

Comeback again i will think more stories for you

and enable the end of the conversation and click Save

3\. For **actions\_intent\_NO\_INPUT** enable the webhook and click save

4\. For **actions\_intent\_OPTION** create two followup intents namely

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1698055608110/b7e11543-5359-4b1b-9c37-6cace9aff368.png)

then in **actions\_intent\_OPTION** enable webhook as well as in Events to add Google Assitant option

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1698055609390/289061e8-e15f-4819-9e4f-2bb715a928bb.jpeg)

For **actions\_intent\_OPTION-more-stories** enable webhook and save the intent and for the **actions\_intent\_OPTION-cancel** add the response and enable the set this as the end of the conversation.

5\. In stories intent, we will do the same as we did in **actions\_intent\_OPTION-more-stories** like creating the two follow up intents

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1698055610696/73a9bae6-3d59-4cff-bf3e-ffbfc89a05de.png)

once done save the intent.

Now we have done with the intent part now we will create a entities

We will create an entity named @story and then add the following

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1698055611956/196b6dc0-e36b-4d92-8e95-8b361726f3bc.jpeg)

Add your story invocation names and it’s synonyms

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1698055613512/b9c1f1b2-6a23-4796-8738-2bca37ad3310.jpeg)

Click Save.

Well, we have completed the Part1 of this blog now it’s time for the Part 2.

Hi ! Welcome to Cartoon Stories
