def search(input, search_term="id", results=None):
    """Search through an input dictionary and return all the matches
    corresponding to a search term

    Parameters
    ----------
    input: Dict
        The input dictionary. In the context of the Workflow Manager, this will
        probably be a json.dump of a workflow file
    search_term: Any
        Anything that can be used as a dictionary key
    results: List, optional
        A list storing the current results. Used when search is called
        recursively e.g. for a dict which has dicts as values.
    """
    if not results:
        # Initial empty results list
        results = []
    if isinstance(input, dict):
        for key, val in input.items():
            if key == "id":
                results.append(val)
            # Search sub-iterables. Note: Don't search stings (even though
            # they are iterables!)
            if isinstance(val, (dict, list, set, tuple)):
                results = search(val, search_term, results)
    elif isinstance(input, (list, set, tuple)):
        for val in input:
            results = search(val, search_term, results)
    return results