> For the complete documentation index, see llms.txt.
Skip to main content

Check out Port for yourself ➜ 

Factory.ai

FactoryAi iconFactoryAi icon
Loading version...

Port's Factory.ai integration surfaces Droid environments, computers, sessions, and organization users in your Context Lake. From there, you can start or continue Droid turns directly from Port workflows with the execute_droid action.

Supported resources External link iconenvironmentcomputersessionuser

Execute a Droid turn​

Use Port workflows to run Factory Droid headlessly against an environment (provision a new computer and session), an existing computer (new session), or an existing session (follow-up). See the Factory.ai integration action page for the full field reference and workflow examples.

No Factory outbound webhooks

Factory does not emit outbound webhooks. Catalog updates rely on scheduled or manual resync, and the execute_droid action polls Factory when waitForCompletion is true (default).

Prerequisites​

  • A Factory API key with access to the Factory Public API (Authorization: Bearer <key>).
  • Your Port user role is set to Admin.

Setup​

Choose one of the installation methods below. If you are not sure which option to use, review the installation methods overview.

Choose method

Configuration​

Port integrations use a YAML mapping block to ingest data from the third-party API into Port.

The mapping uses the JQ JSON processor to transform fields and shape incoming Factory data into Port entities.

Resource selectors​

In addition to query, each resource supports optional selector fields that map to Factory list query parameters:

ResourceFieldDefaultDescription
environmentserviceAccountIdunsetOptional serviceAccountId query param for GET /api/v0/environments.
computerserviceAccountIdunsetOptional filter for GET /api/v0/computers.
computerhostIdunsetOptional host filter for GET /api/v0/computers.
computerincludeProvisioningStepsunsetWhen set, include provisioning steps in each computer payload.
computerincludeUnlistedunsetWhen true, include unlisted computers in the list response.
sessioncomputerIdunsetOptional filter to list sessions for one computer.
sessionlimit100Page size for cursor pagination (1–100).
userlimit100Page size for cursor pagination (1–100).
Sessions API access

If your organization does not have Factory Sessions API access, list calls can return HTTP 403. The integration soft-fails for session during resync (other kinds still reconcile). Contact Factory support or your account team if you expect session data but see none after sync.

Default mapping configuration​

Default mapping configuration (click to expand)
deleteDependentEntities: true
createMissingRelatedEntities: true
resources:
- kind: environment
selector:
query: 'true'
port:
entity:
mappings:
identifier: .id
title: .name
blueprint: '"factory_environment"'
properties:
status: .status
scope: .scope
isDefault: .isDefault
sourceName: .source.name
providerName: .source.provider.name
repositoryUrls: '[.repositories[]?.url | select(. != null and . != "")]'
latestBuildStatus: .latestBuild.status
createdAt: '(.createdAt / 1000 | strftime("%Y-%m-%dT%H:%M:%SZ"))'
updatedAt: '(.updatedAt / 1000 | strftime("%Y-%m-%dT%H:%M:%SZ"))'
- kind: computer
selector:
query: 'true'
port:
entity:
mappings:
identifier: .id
title: .name
blueprint: '"factory_computer"'
properties:
status: .status
providerStatus: .providerStatus
providerType: .providerType
isListed: .isListed
diskBand: .disk.band
ownerPrincipalKind: .ownerPrincipalKind
lastSeenAt: '(.lastSeenAt / 1000 | strftime("%Y-%m-%dT%H:%M:%SZ"))?'
createdAt: '(.createdAt / 1000 | strftime("%Y-%m-%dT%H:%M:%SZ"))'
relations:
environment: >-
.computerSource
| if .kind == "environment" then .environmentId
elif .kind == "template" then .templateId
else empty end
- kind: user
selector:
query: 'true'
port:
entity:
mappings:
identifier: .id
title: >-
([.firstName, .lastName] | map(select(. != null and . != "")) | join(" "))
as $name
| if $name == "" then .email else $name end
blueprint: '"factory_user"'
properties:
email: .email
firstName: .firstName
lastName: .lastName
role: .role
status: .status
lastSignInAt: .lastSignInAt
createdAt: .createdAt
- kind: session
selector:
query: 'true'
port:
entity:
mappings:
identifier: .sessionId
title: '.title // .sessionId'
blueprint: '"factory_session"'
properties:
status: .status
messageCount: .messageCount
factoryCredits: .factoryCredits
model: .sessionSettings.model
interactionMode: .sessionSettings.interactionMode
autonomyLevel: .sessionSettings.autonomyLevel
repoRoot: .sessionSettings.worktree.repoRoot
createdAt: '(.createdAt / 1000 | strftime("%Y-%m-%dT%H:%M:%SZ"))'
updatedAt: '(.updatedAt / 1000 | strftime("%Y-%m-%dT%H:%M:%SZ"))'
completedAt: '(.completedAt / 1000 | strftime("%Y-%m-%dT%H:%M:%SZ"))?'
relations:
computer: .computerId
parentSession: .parent_session_id

Mapping & examples per resource​

To view and test the integration mapping against sample API responses, use the jq playground in your connectors page.

Monitoring and sync status​

To learn more about how to monitor and check the sync status of your integration, see the relevant documentation.