Quickstart: gen 2 Openflow¶
This topic walks through what’s needed to get your first gen 2 connector up and running. For background on how gen 2 Openflow differs from gen 1, see Openflow gen 1 and gen 2.
If you already have gen 1 deployments and runtimes that you want to bring into gen 2, follow the migration path instead of creating new resources here. Migration from gen 1 to gen 2 is available in Private Preview; contact your Snowflake account representative to be included. Return to this quickstart to set up privileges if you haven’t done that yet (the privilege grants in Set up privileges apply regardless of how you create your gen 2 resources).
Before you begin¶
Complete the standard Openflow prerequisites described in About Openflow—role configuration, terms of service, and deployment-type planning (BYOC or Openflow - Snowflake Deployment).
Gen 2 uses different account- and schema-level privileges than gen 1. If you previously set up Openflow using the public guides, see Openflow gen 1 and gen 2 for how the privilege model differs.
Set up privileges¶
An account administrator grants privileges; an Openflow administrator role creates the database, schema, and gen 2 objects.
Grant privileges (account administrator)¶
Create database and schema (Openflow administrator)¶
Create a database and schema to house gen 2 Openflow objects—runtimes and connectors are schema-level objects stored here. This is your Openflow control schema, not the database where connectors load data. Grant the execute-as role access to destination databases separately (see Create an execute-as role).
Runtimes are schema-level objects. To run SQL against a runtime, users need USAGE, OPERATE, or
MONITOR on the runtime and USAGE on its database and schema. You can use a simple name when the
session database and schema are set—the same name resolution rules as other schema-level objects
apply, including in wait functions.
Create a gen 2 deployment¶
Create a gen 2 deployment object with SQL or the Openflow UI. Gen 2 uses
CREATE OPENFLOW DEPLOYMENT—not the gen 1 CREATE OPENFLOW DATA PLANE INTEGRATION. For SQL
parameters (DEPLOYMENT_TYPE, VPC_TYPE, USE_PRIVATE_LINK, EVENT_TABLE, and so on), see
CREATE OPENFLOW DEPLOYMENT.
Note
PrivateLink: If your organization requires private connectivity to Snowflake or the Openflow
UI—not just to your data source—plan PrivateLink before you run CREATE OPENFLOW DEPLOYMENT.
Enable PrivateLink for your account first (see AWS PrivateLink and Snowflake). Set
USE_PRIVATE_LINK = TRUE in your CREATE statement (see
CREATE OPENFLOW DEPLOYMENT). These flags are chosen at
deployment creation; you cannot change them later with ALTER OPENFLOW DEPLOYMENT.
- BYOC: Complete AWS PrivateLink setup (VPC endpoint, DNS, security groups) before you
apply the CloudFormation template—if you deploy without it configured, you typically must create a
new deployment rather than retrofit. Also set
USE_USER_AUTH_OVER_PRIVATELINK = TRUEonly if users access Snowsight or Openflow through a PrivateLink URL; leave itFALSEif they use public URLs (deployment traffic still uses PrivateLink whenUSE_PRIVATE_LINKis enabled). See Configuring PrivateLink in AWS. - Snowflake deployments: Enable PrivateLink when creating the deployment and configure PrivateLink access to the Runtime UI. The user-auth-over-PrivateLink setting does not apply here. See Set up PrivateLink UI access in Openflow - Snowflake Deployments.
Example (BYOC):
Example (Snowflake deployment):
Caution
Each account supports up to three Snowflake Openflow deployments. Gen 1 and gen 2
deployments share this limit; CREATE OPENFLOW DEPLOYMENT WITH DEPLOYMENT_TYPE = SNOWFLAKE
fails when the account already has three Snowflake deployments, regardless of generation.
Next, complete cloud infrastructure setup—the networking and installation steps match the public Openflow guides; only the Snowflake object you create first is different:
- BYOC: CloudFormation template, installation script, and VPC setup. See Set up Openflow - BYOC.
- Snowflake deployments: Core Snowflake and deployment prerequisites. See Set up Openflow - Snowflake Deployment - Task overview.
Create a gen 2 runtime¶
Create a runtime inside your gen 2 deployment. Use the database and schema you created in Set up privileges.
Create an execute-as role¶
EXECUTE_AS_ROLE is the Snowflake role that connectors use when reading from and writing to
Snowflake during connector execution. Snowflake access follows that role’s grants—not your session
role and not privileges on the runtime’s home schema. Grant the control schema and other
connector-specific objects before you create the runtime (destination database grants are in
Before you install a connector).
Grant READ on any Snowflake secrets the connector references (often in the control schema), plus USAGE on the secret’s database and schema. See Configure a gen 2 connector with SQL for secret grants. For background on the execute-as role, see Openflow gen 1 and gen 2 or What is an execute-as role?.
Configure external access (Snowflake deployments)¶
Openflow BYOC runtimes reach external sources through outbound connectivity you configure in your cloud environment; EAIs are not used. See Set up Openflow - BYOC.
For Openflow - Snowflake Deployments, the runtime must be associated with an external access integration (EAI) before connectors can reach external sources. The hostname and port in the network rule come from your connector’s setup topic—update the rule before you start the connector (see Before you install a connector).
- Create a network rule shell (placeholder
VALUE_LISTis fine for now). - Create an external access integration that references the network rule.
- Grant
USAGEon the integration toopenflow_execute_as_rl. - Pass the integration in
EXTERNAL_ACCESS_INTEGRATIONSwhen you create the runtime (next section), or runALTER OPENFLOW RUNTIME ... ADD EXTERNAL_ACCESS_INTEGRATIONSafterward.
Network rules are schema-level objects. Set the session database and schema (or use a fully qualified rule name) before you create them:
If your source system is reachable only over outbound PrivateLink (not the public internet),
use TYPE = PRIVATE_HOST_PORT network rules and provision private connectivity endpoints before
you create the EAI. Outbound PrivateLink requires Business Critical Edition (or later). See
External network locations using external access integrations and
Choosing the public internet or private connectivity
(AWS, Azure, and Google Cloud private-connectivity topics are linked from that page).
Create the runtime¶
Set the session context, then create the runtime:
For a Snowflake deployment, add EXTERNAL_ACCESS_INTEGRATIONS so the runtime can use the EAI you
created:
To add or change EAIs on an existing runtime, see ADD EXTERNAL_ACCESS_INTEGRATIONS in
ALTER OPENFLOW RUNTIME.
Create a gen 2 connector¶
Before you install a connector¶
Complete connector-specific setup before you run the wizard or start a connector:
- Network rule (Snowflake deployments): Update the rule you created for the runtime with the source hostname and port from your connector’s setup topic. For domain lists by connector, see Set up Openflow - Snowflake Deployment: Configure allowed domains for Openflow connectors.
- Destination database (PostgreSQL CDC and MySQL CDC): Create a destination database if you
don’t already have one. Grant the runtime’s
EXECUTE_AS_ROLEUSAGE on the database and CREATE SCHEMA on the database—the connector creates destination schemas; you do not grant USAGE on a pre-existing destination schema. Also grant USAGE, OPERATE on the ingest warehouse. See Set up the Openflow Connector for PostgreSQL or Set up the Openflow Connector for MySQL for full destination setup. - Secrets: Create Snowflake secrets for credentials (for
example, database passwords) and grant READ to the runtime’s
EXECUTE_AS_ROLE. Check your connector’s setup topic for the required secret type. See Create an execute-as role. - Source preparation: Follow the public connector setup topic for your source (for example, PostgreSQL publication and replication for PostgreSQL CDC).
For your first connector, using the setup wizard is recommended:
- Configure a connector with the setup wizard — Install a gen 2 catalog entry with step-by-step validation. The wizard manages configuration and versioning; you do not need gen 2 connector configuration and versioning for day-to-day UI setup.
To create another connector from an already validated configuration—for example, when promoting the same settings to another runtime—see Create from a known configuration in gen 2 connector configuration and versioning.
Create a connector with SQL (optional)¶
Use SQL when you need automation or repeat deployments. See Configure a gen 2 connector with SQL for the full workflow.
Example (PostgreSQL CDC connector):
Use the catalog definition ID in FROM DEFINITION. For PostgreSQL CDC, the ID is
OPENFLOW_POSTGRES_CDC. To list definition IDs available in your account, run
SHOW OPENFLOW CONNECTOR DEFINITIONS (see SHOW OPENFLOW CONNECTOR DEFINITIONS).
The connector will be in a STOPPED state and is a Draft until you commit a configuration version. See Configure a gen 2 connector with SQL (and gen 2 connector configuration and versioning if you use SQL or automation).
Start the connector¶
After configuration is committed:
Manage the connector from the UI (Installed Connectors » Start / Stop) or with SQL. See Manage the gen 2 Openflow connector lifecycle.
Next steps¶
- Configure a gen 2 connector with SQL — Full SQL workflow to configure and commit connector settings.
- Second generation Openflow SQL command reference — Full SQL command reference for gen 2 objects.
- gen 2 connector configuration and versioning — Versioning model for SQL and Git (optional if you use the UI only).
- Openflow gen 1 and gen 2 — gen 1 vs gen 2 comparison, key differences, and documentation map.