def METHOD_NAME(batch_size, offset):
    return f"""
        INSERT INTO artifact (flow_run_state_id, flow_run_id, data)
        SELECT id, flow_run_id, data
        FROM flow_run_state
        WHERE has_data IS TRUE
        ORDER by id
        LIMIT {batch_size} OFFSET {offset};
    """