def _format_action_exec_result(
        self, action_node, liveaction_db, created_at, updated_at, error=None
    ):
        """
        Format ActionExecution result so it can be used in the final action result output.

        :rtype: ``dict``
        """
        if not isinstance(created_at, datetime.datetime):
            raise TypeError(
                f"The created_at is not a datetime object was({type(created_at)})."
            )
        if not isinstance(updated_at, datetime.datetime):
            raise TypeError(
                f"The updated_at is not a datetime object was({type(updated_at)})."
            )

        result = {}

        execution_db = None
        if liveaction_db:
            execution_db = ActionExecution.get(liveaction__id=str(liveaction_db.id))

        result["id"] = action_node.name
        result["name"] = action_node.name
        result["execution_id"] = str(execution_db.id) if execution_db else None
        result["liveaction_id"] = str(liveaction_db.id) if liveaction_db else None
        result["workflow"] = None

        result["created_at"] = isotime.format(dt=created_at)
        result["updated_at"] = isotime.format(dt=updated_at)

        if error or not liveaction_db:
            result["state"] = action_constants.LIVEACTION_STATUS_FAILED
        else:
            result["state"] = liveaction_db.status

        if error:
            result["result"] = error
        else:
            result["result"] = liveaction_db.result

        return result

        Format ActionExecution result so it can be used in the final action result output.

        :rtype: ``dict``
        
contrib/runners/action_chain_runner/action_chain_runner/action_chain_runner.py