Portal Community

What Is a Datasource?

A datasource in BizFirstGO is a named, tenant-scoped connection to an external data store. Each datasource has a unique datasourceId string identifier that workflow nodes reference. The actual connection string is stored securely in the BizFirstGO credential store and resolved at runtime — it never appears in workflow definitions.

Datasources are registered once per environment and can be reused across any number of workflows. To change the connection target (e.g., promote from staging to production), you update the datasource's credential — not every workflow that uses it.

Registration: Two Options

Option A — Through the BizFirstGO Admin Portal

1

Register the Credential

Go to Admin → Credential Store → Add Credential. Select type ConnectionString. Paste the SQL Server connection string. Note the generated credentialId.

2

Register the Datasource

Go to Admin → Datasources → Add Datasource. Set:

  • datasourceId: a slug like customer-data-db
  • type: SqlServer
  • credentialId: the ID from step 1
  • defaultSchema: dbo (or your application schema)
  • commandTimeoutSeconds: 30

3

Test the Connection

Click Test Connection. The portal executes SELECT 1 against the datasource and reports success or the error message.

Option B — Via the Datasource API

// POST /api/datasources
{
  "datasourceId": "customer-data-db",
  "tenantId": 42,
  "type": "SqlServer",
  "credentialId": 1001,
  "defaultSchema": "dbo",
  "commandTimeoutSeconds": 30,
  "maxRetryCount": 3,
  "metadata": {
    "description": "Customer data domain — Data Ocean primary store",
    "environment": "production",
    "owner": "platform-team"
  }
}

Datasource Configuration Fields

FieldTypeRequiredDescription
datasourceIdstringYesUnique identifier used in SQL node configuration. Use kebab-case slugs. Example: customer-data-db
tenantIdintYesTenant that owns this datasource. Datasources are tenant-scoped.
typeenumYesMust be SqlServer for SQL Server datasources. Other values: PostgreSQL, MySQL, Oracle.
credentialIdintYesReferences the credential store entry holding the connection string.
defaultSchemastringNoDefault schema for unqualified table references. Defaults to dbo.
commandTimeoutSecondsintNoSQL command timeout. Default: 30. Increase for long-running batch queries. Max: 300.
maxRetryCountintNoRetry count for transient SQL errors. Default: 3. Uses exponential back-off.
metadataobjectNoFree-form JSON for documentation/tagging purposes. Not used at runtime.

How the Runtime Resolves a Datasource

// Simplified IDatasourceConnectionFactory implementation
public interface IDatasourceConnectionFactory
{
    Task<SqlConnection> GetConnectionAsync(
        string datasourceId,
        int tenantId,
        CancellationToken ct = default);
}

// Internal resolution sequence:
// 1. Load datasource record from cache (keyed by tenantId + datasourceId)
// 2. Call ICredentialResolver.GetConnectionStringAsync(datasource.CredentialId)
// 3. Open SqlConnection with the resolved connection string
// 4. Return the open connection to the SQL node for query execution

Using the Datasource in a SQL Node

Once registered, reference the datasourceId directly in Flow Studio SQL nodes:

// SqlQueryNode configuration (JSON representation)
{
  "nodeType": "SqlQueryNode",
  "datasourceId": "customer-data-db",
  "query": "SELECT CustomerId, Name, Email FROM Customer WHERE TenantId = @tenantId AND CustomerId = @customerId",
  "parameters": {
    "tenantId": "{{workflow.tenantId}}",
    "customerId": "{{input.customerId}}"
  },
  "outputVariable": "customer"
}
Datasource Changes Are Zero-Downtime

If you need to point a datasource to a different server (e.g., after a database migration), update the credential in the credential store. The datasource cache invalidates automatically on credential update. Running workflows pick up the new connection on their next SQL node execution — no workflow restarts required.

Multiple Datasources Per Tenant

A single tenant can have many datasources — one per application domain, one per environment, one per third-party database integration. There is no practical limit. Name them clearly:

Workflows use the datasourceId string, so migrating from staging to production is as simple as updating the node configuration from customer-data-staging to customer-data-prod.