Your action's 'action_humanagent' run method returned an invalid event. Event will be ignored. Event: 'ConversationPaused()'

Rasa version :

Rasa X version (if used & relevant): 0.13.7

Python version : 3.6.5

Operating system : Win 10

Issue : I am trying to achieve user to a human agent but it is not pausing the conversation. for pausing the conversation I am using ConversationPaused() . I hope I am importing correct packages.

Content of domain file ( :

from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from rasa_core.trackers import DialogueStateTracker
from rasa_core.domain import Domain
from import (
import logging
import requests
import json
from rasa_sdk import Action

class Action_Humanagent(Action):
    def name(self):
            return "action_humanagent"

    def run(self, dispatcher, tracker, domain):
            response = ("Reaching out to a human agent")

            message = ""
            while message != "/unpause":
                url = "{}".format(tracker.sender_id) `//API server is written in **** file, please find it below.`
                req = requests.get(url)
                resp = json.loads(req.text)
                if "error" in resp:
                    raise Exception("Error fetching message: " + repr(resp["error"]))
                message = resp["message"]
                if message != "/unpause":
                    dispatcher.utter_message("Human agent: {}".format(message))
           return [ConversationPaused() ]

Hello, @akelad as you said I tried return [coonversationPaused()] but it is giving me error.
Your action’s ‘action_humanagent’ run method returned an invalid event. Event will be ignored. Event: ‘ConversationPaused()'

Please help me out

Thank you!!

did you import the event first?

Thank you for reply

Yes I had import following thing. Is it right?

it should be from


@sushilr007 could you share file?


You mean this one ?

import time
from flask import Flask, jsonify, request

app = Flask(__name__)

def hello():
    return "hello, bots"

meetup_store = {"toronto": {"tech": [251176370]}}

# @app.route("/handoff/<sender_id>", methods=["GET", "POST"])
@app.route("/handoff", methods=["GET", "POST"])
# def handoff(sender_id):
def handoff():
    if request.method == "POST":
        add sender id to sender store
        if sender_id in sender_store:
            return jsonify(sender_store[sender_id])
            return jsonify({"error": "sender_id not found"})
        retry 10 times with 10 sec sleeps to fetch info
        if sender_id not in sender_store:
            sender_store[sender_id] = {"paused": True, "replies": []}

        ## poll on replies to fetch the message
        while len(sender_store[sender_id]["replies"]) == 0:

        message = sender_store[sender_id]["replies"].pop(0)
        return jsonify({"message": message})

if __name__ == "__main__":"HOST"), port=app.config.get("PORT"))

yes, we have to change in api file.

@ravikrcs Is you code working successfully ?

No, i am working on that.

What a wonderful topic. I am having a few trouble matter. It helps me very much

@ravikrcs , is there any update on this? I am stuck at this. Where do we need to change the api file? and what is the change?