def workflow_step_media_location(instance, filename):
    """Return the location of a stored media file for a Workflow Step."""
    workflow_id = instance.workflow_step.workflow.id
    step_id = instance.workflow_step_id
    ui_identifier = instance.ui_identifier
    file_extension = filename.rpartition(".")[2]

    return f"workflow_system/workflows/{workflow_id}/steps/{step_id}/{ui_identifier}.{file_extension}"