FollowupAction not work after Custom action_session_start Action

Hi, I am trying to tag conversation by metedata after get message from user. And I have wrote a custom action_session_start Action.

I have tried call RASA-X api in action_session_start Action and it seems that conversation have not yet been build.

And I also tried to use FollowupAction event after ActionExecuted("action_listen") , according rasa-x log, it shows that FollowupAction is in rasa.core.processor but my code not run.

Here is my action_session_start Action:

class ActionSessionStart(Action):
    def name(self) -> Text:
        return "action_session_start"

    async def run(
        self, dispatcher, tracker: Tracker, domain: Dict[Text, Any]
    ) -> List[Dict[Text, Any]]:
        events = [SessionStarted()]
        events.append(ActionExecuted("action_listen"))
        events.append(FollowupAction("action_tag_conversation"))
        return events

custom tag action:

class ActionTagCategory(Action):
    
    def name(self):
        return "action_tag_conversation"

    def run(
        self,
        dispatcher: CollectingDispatcher,
        tracker: Tracker,
        domain: DomainDict,
    ) -> List[EventType]:
        value = tracker.get_slot("业务分类")
        category_dict = {
            "飞机票": "FF7E79",
            "专车": "FFD579",
            "酒店": "FFFD78",
            "火车票": "73FB79",
            "商城": "73FEFF",
            "打车": "7A81FF",
            "企业": "D883FF",
            "会员服务": "FF8AD8",
        }
        color = category_dict[value]
        rasax = RasaXAPI()
        rasax.tag_convo(
            tracker,
            json.dumps([{"value": value, "color": color}]),
        )

        return []

Yeah, this makes sense as the events are only saved and forwarded once we have predicted all actions after a message and are waiting for the next user message. The FollowupAction hence also wouldn’t work for this one. I think the best way would be to return a slot which serves as marker and then auto tag this in Rasa X but I don’ think that’s possible now :thinking:

How about you spawn something like a separate thread which waits for a few seconds and then does the tagging? So the custom action would return immediately but the tagging would continue to run in the background?

The way I currently solve this problem is to create a conversation in advance via /session_start.

Once the conversation is created, tagging is no problem.