Factory.ai
Factory.ai integration actions allow workflows to run headless Droid turns directly using your installed Factory.ai integration.
Prerequisites
- A Factory.ai integration installed in your Port organization.
- Actions processing must be enabled on your integration:
- Hosted by Port: actions processing is enabled automatically.
- Self-hosted (Helm or Docker): actions processing is disabled by default and must be explicitly enabled.
- A Factory API key with permission to call
POST /api/v0/droid/execute.
Configuration
| Field | Type | Description |
|---|---|---|
type | string | Required. Must be "INTEGRATION_ACTION" |
installationId | string | Required. Your Factory.ai integration installation ID |
integrationProvider | string | Required. Must be "factory-ai" |
integrationInvocationType | enum | Required. One of the values listed in available actions |
integrationActionExecutionProperties | object | Required. Properties for the selected action |
Action semantics
Factory accepts a Droid turn with POST /api/v0/droid/execute and responds with 202 Accepted when the turn is queued. Factory does not send outbound webhooks, so completion tracking is handled inside the integration.
waitForCompletion | Port run behavior |
|---|---|
true (default) | The Port run stays IN_PROGRESS. The integration polls Factory until the session is idle and an assistant message exists after the returned messageId. On success, run output includes session details and assistant reply fields (for example assistantText). |
false | The Port run completes right after the 202 with sessionId, messageId, computerId, and links to the Factory app. |
Follow-ups that target the same sessionId are serialized so concurrent executes do not race on one session. Runs that start new sessions on different targets can run in parallel.
Available actions
Each action is selected with the integrationInvocationType field:
| Action | Invocation type | Description |
|---|---|---|
| Execute Droid | execute_droid | Start or continue a headless Droid turn on an environment, computer, or session |
Execute Droid
Calls Factory POST /api/v0/droid/execute. Set targetKind to choose where the turn runs:
environment— provision a fresh computer from the environment's active build and start a new session. RequiresenvironmentId.computer— start a new session on an existing computer. RequirescomputerId.session— send a follow-up on an existing session. RequiressessionId. OmitmodelandreasoningEffortfor session follow-ups.
Execution properties
| Field | Type | Description |
|---|---|---|
prompt | string | Required. User message or instructions for the Droid turn. |
targetKind | string | Required. One of environment, computer, or session. |
environmentId | string | Required when targetKind is environment. Omit for computer and session. |
computerId | string | Required when targetKind is computer. Omit for environment and session. |
sessionId | string | Required when targetKind is session. Omit for environment and computer. |
model | string | Optional model for a new session (environment or computer targets only). |
reasoningEffort | string | Optional reasoning effort for a new session: none, dynamic, off, minimal, low, medium, high, xhigh, or max. Applies only to environment or computer targets. |
waitForCompletion | boolean | When true (default), keep the Port run open until the turn completes. When false, complete after Factory accepts the turn. See action semantics. |
Basic example — new session from an environment
Run Droid on an environment (click to expand)
{
"identifier": "run-factory-droid",
"title": "Run Factory Droid",
"config": {
"type": "INTEGRATION_ACTION",
"installationId": "<your-installation-id>",
"integrationProvider": "factory-ai",
"integrationInvocationType": "execute_droid",
"integrationActionExecutionProperties": {
"prompt": "{{ .outputs.trigger.prompt }}",
"targetKind": "environment",
"environmentId": "{{ .outputs.trigger.environmentId }}",
"waitForCompletion": true
}
}
}
Basic example — session follow-up
Continue an existing session (click to expand)
{
"identifier": "factory-droid-follow-up",
"title": "Factory Droid follow-up",
"config": {
"type": "INTEGRATION_ACTION",
"installationId": "<your-installation-id>",
"integrationProvider": "factory-ai",
"integrationInvocationType": "execute_droid",
"integrationActionExecutionProperties": {
"prompt": "{{ .outputs.enrich.followUpPrompt }}",
"targetKind": "session",
"sessionId": "{{ .outputs.trigger.sessionId }}",
"waitForCompletion": false
}
}
}