# Rasa template response via custom action server generating empty response

**URL:** <https://forum.rasa.com/t/rasa-template-response-via-custom-action-server-generating-empty-response/58958>\
**Category:** Rasa Open Source\
**Created:** [July 11, 2023, 2:55am UTC](https://forum.rasa.com/t/rasa-template-response-via-custom-action-server-generating-empty-response/58958 "2023-07-11T02:55:14Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![aman-nankani](https://avatars.discourse-cdn.com/v4/letter/a/4491bb/32.png) [@aman-nankani](https://forum.rasa.com/u/aman-nankani)\
**Post date:** [July 11, 2023, 2:55am UTC](https://forum.rasa.com/t/rasa-template-response-via-custom-action-server-generating-empty-response/58958/1 "2023-07-11T02:55:14Z")

</div>

I am referring to the following article from Rasa for generating a template-based response from my custom action server. The details are in the section titled “Calling Responses from Custom Actions”.

Link to the article - [https://rasa.com/docs/rasa/responses/](https://rasa.com/docs/rasa/responses/)

Following is my domain.yml file

```auto
version: '3.0'
session_config:
  session_expiration_time: 60
  carry_over_slots_to_new_session: true
intents:
- greet
- create_OPEX

responses:
  utter_greet:
  - text: |
      Hello! How can I help you?
  - text: |
      Hi!

actions:
- action_create_OPEX_Sheet

```

And my stories.yml looks something like this:

```auto
stories:
 - story: greet and create_OPEX
   steps:
   - intent: greet
   - action: utter_greet
   - intent: create_OPEX
   - action: action_create_OPEX_Sheet

```

The “action\_create\_OPEX\_Sheet” action sends a REST call to my custom action server (Java Spring Boot), which returns the response in the following format:

```auto
{
    "responses": [
        {
            "template": "utter_greet"
        }
    ],
    "events": []
}

```

This format is the same as provided in the article above, my problem is that despite my server sending a template response back, Rasa doesn’t send or generate any response based on that. It returns an empty response to the chatbot.

However, when I modify my custom action server to return a text-based response, it does work fine. In that case, it’ll return whatever text I send from my custom action server. But, I want template-based responses to work.

The text-based response being sent from the custom action server:

```auto
{
    "responses": [
        {
            "text": "sample response from custom action server"
        }
    ],
    "events": []
}

```

Can you please let me know what am I doing wrong in this? Any help would be appreciated, thanks.

Version Details:

Rasa Version: 3.5.5 Minimum Compatible Version: 3.5.0 Rasa SDK Version: 3.5.1 Python Version: 3.10.11 Operating System: Windows-10-10.0.22621-SP0 Python Path: C:\Users\amann\AppData\Local\Programs\Python\Python310\python.exe

---

<div class="post-metadata">

**Author:** ![anoopshrma](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/anoopshrma/32/13349_2.png) [@anoopshrma](https://forum.rasa.com/u/anoopshrma)\
**Post date:** [July 11, 2023, 7:00am UTC](https://forum.rasa.com/t/rasa-template-response-via-custom-action-server-generating-empty-response/58958/2 "2023-07-11T07:00:17Z")

</div>

Hi @aman-nankani

You have rasa action server and from there you are calling your Java application. Correct?

To display the output from Rasa action server, You could try something like this

```py
class ActionGreetUser(Action):
    def name(self) -> Text:
        return "action_greet_user"

    async def run(
        self,
        dispatcher: CollectingDispatcher,
        tracker: Tracker,
        domain: Dict[Text, Any],
    ) -> List[EventType]:
         CALL_YOUR_JAVA_APPLICATION_HERE
        dispatcher.utter_message(text = "JAVA_OUTPUT")

        return []

```

You can take more help following this link: [Rasa action server Dispatcher](https://rasa.com/docs/rasa/action-server/sdk-dispatcher/)

---

<div class="post-metadata">

**Author:** ![aman-nankani](https://avatars.discourse-cdn.com/v4/letter/a/4491bb/32.png) [@aman-nankani](https://forum.rasa.com/u/aman-nankani)\
**Post date:** [July 11, 2023, 7:59am UTC](https://forum.rasa.com/t/rasa-template-response-via-custom-action-server-generating-empty-response/58958/3 "2023-07-11T07:59:09Z")

</div>

@anoopshrma - No no, I am using my Java Application as a “custom action server”.

---

<div class="post-metadata">

**Author:** ![anoopshrma](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/anoopshrma/32/13349_2.png) [@anoopshrma](https://forum.rasa.com/u/anoopshrma)\
**Post date:** [July 11, 2023, 10:05am UTC](https://forum.rasa.com/t/rasa-template-response-via-custom-action-server-generating-empty-response/58958/4 "2023-07-11T10:05:54Z")

</div>

Rasa themselves do not provide Custom Action Server in Java. May I know which page/github/article you are using to create your custom action server?

---

<div class="post-metadata">

**Author:** ![aman-nankani](https://avatars.discourse-cdn.com/v4/letter/a/4491bb/32.png) [@aman-nankani](https://forum.rasa.com/u/aman-nankani)\
**Post date:** [July 11, 2023, 10:51am UTC](https://forum.rasa.com/t/rasa-template-response-via-custom-action-server-generating-empty-response/58958/5 "2023-07-11T10:51:42Z")

</div>

@anoopshrma - Yes, the custom action server in Java is my own. It’s a spring boot application.

This is why I am referring the following section of the article, where it has the details for a custom action server, and what to return from it. Attaching the screenshot for the same.

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/rasa/original/3X/3/0/30c94bcc48af97eb1e5b39921337e4122c0cf601.png)

The problem is that even if I am returning the response in the same format as shown in the image, I am not able to get any response in Rasa chatbot.

Thanks
