Integrations Workflow¶
Generated apps and workflows request external integration setup through the platform connector flow. They must not embed credentials in generated code, create app-owned secret tables, or expose secret values to frontend read APIs.
Storage¶
Connector metadata is app- or workspace-scoped platform state. It records service id, provider id, integration id, display name, status, public non-secret config, source workflow, and whether a vault secret is available. Secret values are stored only through the configured connector vault backend. If no vault is configured, metadata can still be saved, but the raw secret is not durable. Vault operations use the same explicit (scope, scope_id, normalized_service) identity as metadata. App overrides and workspace defaults can share an ID and service without sharing a credential. resolve_connector keeps the app-first, workspace-fallback metadata choice; the chosen record's scope governs its server-side secret read. Older unqualified vault records are not read.
Inline Request¶
When a workflow reaches a real credential/configuration boundary, it emits an integration.required request:
integration_id: email_provider
provider: email_provider
purpose: Send transactional notifications.
required_fields:
- name: api_key
label: API Key
type: secret
required: true
frontend_safe: false
- name: sender_domain
label: Sender Domain
type: text
required: true
frontend_safe: true
preferred_setup_lane: bring_your_own_key
allowed_setup_lanes:
- bring_your_own_key
permissions_required:
- integrations.manage
resume:
workflow_name: AppGenerator
run_id: run_123
step_id: task_notifications
tool_call_id: connector_bundle_email_provider
The UI may render the request inline or link to /apps/{appId}/integrations. Secret fields are write-only. Non-secret fields marked frontend_safe: true may be persisted as connector metadata. Setup lanes are app-agnostic: managed, connect_account, bring_your_own_key, or not_required.
Workflow Behavior¶
agent/tool discovers need
-> record_integration_need / AppBuildPlan.external_integrations
-> IntegrationReadinessAgent checks app-scoped connector inventory
-> existing ready connector: continue
-> missing required setup: emit integration.required inline UI request
-> user/operator submits write-only secrets + frontend-safe config
-> connector service stores secret via vault and metadata/public_config via connector store
-> readiness recheck passes or returns blocked with unresolved service ids
- The agent or tool records an integration need.
- The readiness checkpoint checks existing app-scoped connectors.
- Missing required setup is requested inline.
- The backend saves secrets through the connector service and saves only sanitized metadata.
- The workflow resumes from the correlated UI tool response.
- If required setup is declined or unavailable, the checkpoint returns
blockedwith unresolved service ids.
Generated app code references connector ids/capabilities and reads integration state through server-side adapters. It never receives raw secrets.
AppGenerator also materializes the app's declared integration requirements to app/config/integrations.yaml. That file is a generated-app declarative contract, not a secret store. It contains service ids, setup lanes, field names, frontend-safe metadata, and required_by references only.
Deployment/runtime target intent is materialized to app/config/targets.json. It records app-neutral runtime/deployment facts such as health path, deployment profile, and expected environment variable names. Hosted products may consume that contract, but provider mechanics remain outside the generated app.
The readiness checkpoint is the task-result merge boundary before validation/download. It does not require manual preflight setup; it waits until the build has a concrete missing integration need, asks inline, then rechecks the connector inventory. Resume is handled by the same correlated chat.tool_call response path used by other workflow UI tools.
Connector Health¶
Readiness and health are related but distinct:
- readiness answers: can this workflow/build proceed now?
- health answers: what should an operator know about this connector's current configuration state?
Connector health is frontend-safe and never includes secret values:
health:
status: unknown | not_configured | configured | healthy | unhealthy
last_checked_at: timestamp | null
message: string | null
missing_fields: []
checked_by: readiness | manual | provider_check
frontend_safe: true
Default health is configuration-only and does not call external providers. It marks a connector not_configured when required secret fields have no stored secret or required frontend-safe fields are missing from public_config. It marks a connector configured when all required fields are present and no provider validation has run. Optional fields never block configured status.
healthy and unhealthy are reserved for future provider-specific checks. Those checks must be explicitly declared by a connector/provider adapter and must not run by default.
Provider Health Plugins¶
Provider-specific health checks are optional server-side plugins. They are for operator visibility, not default build readiness. The OSS runtime owns the generic plugin contract and registry; real provider checks should live in a hosted/product package or an external package that registers providers at host startup.
Plugins implement this shape:
class ConnectorHealthProvider:
provider_id: str
supported_integration_ids: list[str]
async def check(
self,
*,
connector,
secret_reader,
public_config,
context,
) -> ConnectorHealthResult:
...
ConnectorHealthResult is sanitized before persistence:
status: healthy | unhealthy | unknown
message: string | null
checked_at: timestamp | null
safe_details: {}
error_code: string | null
Checks run only by explicit server-side request from a registered management surface. The frontend must call a Studio/backend endpoint and never call provider APIs directly. Provider checks must not run from page load, connector save, or the default IntegrationReadinessAgent checkpoint.
Secret access is server-only. A plugin receives a ConnectorSecretReader, not a secret value in its constructor or public inputs. The reader can resolve the vault secret for the current app/service, but the secret handle is not serialized, logged, returned to the frontend, or stored in connector metadata. For a workspace connector, the reader uses that workspace's scope and ID.
Only safe health fields may be persisted:
health_statushealth_messagelast_checked_atchecked_byhealth_detailshealth_error_code
health_details is recursively redacted before storage and response rendering. Raw provider responses must not be stored.
Readiness remains configuration-completeness based. An unhealthy provider health result may warn operators, but it does not block AppGenerator readiness or download by default. A future explicit policy such as health_policy: required_for_deployment may add deployment gating, but that policy is intentionally not part of the current contract.
Route Ownership¶
Integrations use a two-tier Studio model. The workspace route manages provider availability once for the whole workspace:
The workspace /integrations route is the provider-management surface. It owns the integration catalog, credential-presence status, setup guidance, and operator notes. Apps do not duplicate global provider setup.
Owners open Studio → My Apps, choose an app and select Integrations at /apps/{appId}/integrations. The page lists that app’s connections and declared build requirements. Owners can configure a service from either list and can store or rotate a write-only credential when a credential store is configured.
admin/admin_registry.yaml may include app-level navigation metadata for the integrations page, but it is not a custom route registry. Full-page React route ownership must remain explicit in ui/route_manifest.json and ui/index.js component registration.
Operator UI¶
The /integrations surface renders the workspace integration catalog for operators without revealing secrets. Each provider should show its display name, category, setup status, required secret names, setup guidance, and operator note. Secret presence is returned as booleans only.
The selected page uses /api/studio/integrations/connectors?dashboard_app_id={appId}. Studio resolves the selected dashboard ID to the authenticated owner’s Factory app record before listing or changing connections. The response exposes app connection metadata, requirements and public catalog entries. Workspace operator credentials stay under the workspace route.
For services with health_check_supported: true, Check status sends an explicit request.
The button must not appear for connectors without a registered health plugin, and the page must not trigger the endpoint automatically. A successful response updates only the displayed safe health fields: status, message, last_checked_at, checked_by, and redacted safe_details. Failures should show a safe operator-facing error and leave existing connector config intact.
Secret fields are write-only. The UI may show a secret field name and whether it is configured or missing, but it must never render the stored value. Public configuration values are shown only from sanitized public_config, and secret-shaped keys such as API keys, tokens, passwords, and secrets must be filtered defensively even if malformed connector metadata reaches the frontend.
AppGenerator¶
AppBuildPlan.external_integrations, capability-pack required_integrations, build-task integration_needs, and task-agent record_integration_need calls feed the same readiness checkpoint. Agents should declare provider-neutral service ids, setup fields, purpose, required lifecycle point, and whether the need is optional. They should also declare preferred_setup_lane and allowed_setup_lanes when the active build context knows the viable setup paths. Capability-pack required_integrations must be structured objects with required_fields; they should not be reduced to string service names when a pack declares public config, secret fields, or managed setup defaults.