Integrate Gretel with your existing data services using Workflows.
With Gretel Workflows, you can train and run one or more Gretel Models by connecting directly to your data sources and destinations. We support the following integrations for data inputs and outputs.
Connections are used to authenticate Workflow Actions. Each action is compatible with a specific type of connection. For example, the s3_source action requires a s3 connection.
Permissions and Connection Sharing
When creating a connection, you must select a project for the connection to reside in. The connection will inherit all the project permissions and user memberships.
Project Permission
Connection Permissions
Read
Users can list and view connection metadata.
Write
Users can access connections in a Workflow.
Administrator
Users can create, edit and delete connections.
Owner
Full control.
Connections can be reused across Workflows, actions, and projects.
Creating Connections
If you're creating Connections in a Hybrid environment, follow along here: Connectors in Hybrid
First, create a file on your local computer containing the connection credentials. This file should also include type, name, config and credentials. The config and credentials field should contain fields that are specific to the connection being created.
Select the project where the connection will be stored.
Next, fill in your credentials and select Add Connection. The example below shows the flow for creating an Amazon S3 connection. All connections follow the same pattern.
The connection can now be used in a workflow.
Data sources also can be configured during a blueprint flow. Go to the Dashboard or Blueprints page and select a use case, for example "Generate synthetic data". This will start a guided flow to help you create a workflow.
Select the option to connect to an external data source, and choose the connection you created above, or create a new one.
from gretel_client import create_or_get_unique_projectfrom gretel_client.config import get_session_configfrom gretel_client.rest_v1.api.connections_api import ConnectionsApifrom gretel_client.rest_v1.models import ( CreateConnectionRequest, UpdateConnectionRequest,)session =get_session_config()connection_api = session.get_v1_api(ConnectionsApi)project =create_or_get_unique_project(name="workflow-testing")connection = connection_api.create_connection(CreateConnectionRequest( name="my-s3-conn", project_id=project.project_guid, type="s3",# note: best practice is to read in credentials from a file# or secret instead of directly embedding sensitive values# in python code. config={"access_key_id": "...", }, credentials={"secret_access_key": "...", }, ))
Updating Connections
Connection types cannot be changed once a connection is created.
To update the connection, follow the steps from Creating Connections to create a credentials file for the updated connection.