def retrieve_jobs(region, domain, workflow_id, oldest):

    roots = list_workflow_executions(
        region=region,
        domain=domain,
        executionFilter={
            'workflowId': workflow_id
        },
        startTimeFilter={
            'oldestDate': oldest
        })

    try:
        start_time = min(map(lambda r: r['startTimestamp'], roots))
    except __HOLE__:
        # roots are not found
        return []
    workflows = list_workflow_executions(
        region=region,
        domain=domain,
        startTimeFilter={
            'oldestDate': start_time
        },
        tagFilter={
            'tag': workflow_id
        })
    jobs = workflows_to_jobs(workflows)
    jobs = datetime_to_timestamp(jobs)
    return jobs
dataset/ETHPy150Open KKBOX/mass/mass/monitor/swf.py/retrieve_jobs