# Workflow$connect\_dbi

### **Workflow$**<mark style="color:purple;">**connect\_dbi**</mark>**()** → [DBI::DBIConnection](https://dbi.r-dbi.org/reference/DBIConnection-class.html)

Returns a DBI connection that can be used by dbplyr and other interfaces that work with DBI. This connection is scoped to the respective workflow, avoiding the need to fully qualify tables.

{% hint style="info" %}
For advanced use cases, you can also access the Redivis DBI interface at `redivis::RedivisDBI`. `workflow$connect_dbi()` is the same as: `DBI::dbConnect(redivis::RedivisDBI(workflow=workflow))`
{% endhint %}

### **Returns:**

[**DBI::DBIConnection**](https://dbi.r-dbi.org/reference/DBIConnection-class.html)

### Examples

```r
con <- redivis$workflow("imathews.example_workflow_climate_analysis")$connect_dbi()

tbl(con, "join_lat_lon_output") |> filter(latitude > 0) |> collect()

# Prints a tibble with the filtered data
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.redivis.com/api/client-libraries/redivis-r/reference/workflow/workflowusdconnect_dbi.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
