> ## Documentation Index
> Fetch the complete documentation index at: https://synthetiq.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# importFromDatabase

> Load data from your app's database into a workflow for processing

Load data from your app's database into a workflow table for processing:

```typescript theme={null}
{
  importFromDatabase: {
    appId: "{{var.appId}}",
    tableName: "Connection",
    whereColumn: "status",
    whereValue: "active",
  },
  outputTable: "active_connections",
  outputSchema: {
    id: "VARCHAR",
    userId: "VARCHAR",
    service: "VARCHAR",
  },
}
```

| Field          | Required | Description                                        |
| -------------- | -------- | -------------------------------------------------- |
| `appId`        | Yes      | App identifier (typically `"{{var.appId}}"`)       |
| `tableName`    | Yes      | Source table name                                  |
| `outputTable`  | Yes      | Name of the table this step produces               |
| `outputSchema` | Yes      | Column names and types for the result output table |
| `whereColumn`  | No       | Column to filter by                                |
| `whereValue`   | No       | Value to match — required if `whereColumn` is set  |

Import steps support [fieldMapping](/docs/platform-docs/workflows-framework/field-mapping) to rename columns and [generate values](/docs/platform-docs/workflows-framework/field-mapping#generated-values) like IDs and timestamps.

## Validation

| Check                                                                                                                                    |
| ---------------------------------------------------------------------------------------------------------------------------------------- |
| `appId`, `tableName`, `outputTable`, `outputSchema` are required                                                                         |
| `whereColumn` and `whereValue` must both be set if either is provided                                                                    |
| `tableName` exists in the app database                                                                                                   |
| `whereColumn` exists in source table                                                                                                     |
| `outputSchema` columns exist in source table (skipped when [fieldMapping](/docs/platform-docs/workflows-framework/field-mapping) is provided) |
