def receive_oaiharvest_job(request, records, name, **kwargs):
    """Receive a list of harvested OAI-PMH records and schedule crawls."""
    spider = kwargs.get('spider')
    workflow = kwargs.get('workflow')
    if not spider or not workflow:
        return

    files_created, _ = write_to_dir(
        records,
        output_dir=current_app.config['CRAWLER_OAIHARVEST_OUTPUT_DIRECTORY']
    )

    for source_file in files_created:
        # URI is required by scrapy.
        file_uri = pathlib2.Path(source_file).as_uri()
        schedule_crawl(spider, workflow, source_file=file_uri)
Receive a list of harvested OAI-PMH records and schedule crawls.