def get_parent_execution(execution_db):
    """Get the action execution for the parent workflow

    Useful for finding the parent workflow. Pass in any ActionExecutionDB instance,
    and this function will return the action execution of the parent workflow.

    :param execution_db: The ActionExecutionDB instance for which to find the parent.
    :rtype: ActionExecutionDB
    """

    if not execution_db.parent:
        return None

    parent_execution_db = ActionExecution.get(id=execution_db.parent)

    return parent_execution_db
Get the action execution for the parent workflow

    Useful for finding the parent workflow. Pass in any ActionExecutionDB instance,
    and this function will return the action execution of the parent workflow.

    :param execution_db: The ActionExecutionDB instance for which to find the parent.
    :rtype: ActionExecutionDB
    
st2common/st2common/services/action.py