Connected System subscriptions[] declare platform tasks that run when a normalized event fires (most often after a Business Entity publishes). After upload, the dataplane syncs each entry into persisted subscription rows and optionally runs runOnCreate tasks once.
Use subscriptions to regenerate Enterprise MCP / COM / contract material when provider datasources publish — not as a free-form workflow engine, and not as an arbitrary Role Assistant task DSL.
Prerequisites
- Connected System JSON validates (
aifabrix validate <systemKey>) - Business Entities that the filter will match already declare the same root
resourceTypetokens - Configure roles and permissions when filters use
roleKeys - Builder help topic
subscriptionGuidefor narrative context — trust the schema enums below if help prose conflicts
Where it lives
| Layer | Location |
|---|---|
| Subscription entries | <systemKey>-system.json → subscriptions[] |
| Optional generation scope | Business Entity JSON → subscriptionFilter (same filter shape) |
| Runtime | Persisted subscription rows after system publish / pipeline upload |
Manifest section: system.subscriptions. UI: Connected System Subscriptions tab when exposed.
What you can build (V1 schema)
Each entry must include:
| Field | Required | Rules |
|---|---|---|
key |
Yes | ^[a-z][a-z0-9-]*$, unique within the system, max 100 chars |
event |
Yes | V1 namespace: platform.*, schedule.*, or record.* |
task |
Yes | Object with type (and optional version) |
displayName / description |
No | Operator-facing labels |
filter |
No | Scopes which datasources / roles / kinds match |
priority |
No | low | normal | high | critical (default normal) |
runOnCreate |
No | true → run once after publish/sync upsert |
Allowed task.type values
Only these platform task types validate on the external-system schema:
task.type |
Typical use |
|---|---|
generateEnterpriseDatasources |
Regenerate enterprise repository / template MCP datasources when providers publish |
compileCom |
Recompile Capability Object Model material for the owner system |
generateRestContracts |
Refresh REST contract artifacts |
generateMcpContracts |
Refresh MCP contract artifacts |
Invalid examples (will fail aifabrix validate): roleAssistantTask, runDigitalWorkerTask, or any custom string.
Common event values
Prefer these normalized names (runtime registry):
| Event | When it fires |
|---|---|
platform.datasource.published |
Business Entity / datasource publish |
platform.datasource.updated |
Datasource update |
platform.datasource.deleted |
Datasource delete |
platform.externalSystem.published |
Connected System publish |
platform.externalSystem.updated |
Connected System update |
platform.com.compiled |
COM compile completed |
record.insert / record.update / record.delete / record.syncCompleted |
Normalized record lifecycle from sync/CIP |
schedule.daily / schedule.hourly / schedule.weekly / schedule.cron |
Schedule namespace |
Do not invent vendor webhook names or wrong prefixes such as platform.record.updated — use record.update.
Filter shape (filter and datasource subscriptionFilter)
All keys optional; empty filter matches broadly (usually undesirable):
| Key | Meaning |
|---|---|
resourceTypes |
Match Business Entity root resourceType tokens |
datasourceKeys |
Match specific entity keys |
systemKeys |
Match Connected System keys |
roleKeys |
Scope Role Assistant / generation inputs by role |
includeSystemKinds / excludeSystemKinds |
Match or skip systemKind values |
Builder MCP
| Manifest section | system.subscriptions |
| UI tab | Subscriptions |
| Help topics | subscriptionGuide, section, dependencyGraph |
| Repair hooks | None — subscriptions do not auto-repair |
How to set
- Pick the platform outcome — which allowed
task.typeshould run (usuallygenerateEnterpriseDatasourcesor a contract regenerate task). - Pick the trigger event — for post-publish generation use
platform.datasource.published. - Scope the filter — list only the
resourceTypes(or keys) that should fire the task. - Add
subscriptions[]on the system JSON — start from a known-good scaffold:
aifabrix create <systemKey> --type external
aifabrix repair <systemKey> --dry-run
- Author the entry (platform lifecycle pattern):
{
"subscriptions": [
{
"key": "enterprise-mcp-on-provider-publish",
"displayName": "Enterprise MCP on provider publish",
"description": "Regenerate enterprise MCP datasources when repository or template providers publish.",
"event": "platform.datasource.published",
"filter": {
"resourceTypes": ["repository", "template"]
},
"task": {
"type": "generateEnterpriseDatasources",
"version": 1
},
"priority": "normal",
"runOnCreate": true
}
]
}
- CRM / record Business Entity pattern — same task enum; filter on your catalog tokens:
{
"subscriptions": [
{
"key": "mcp-contracts-on-customer-publish",
"displayName": "MCP contracts when customers publish",
"event": "platform.datasource.published",
"filter": {
"resourceTypes": ["customer"]
},
"task": {
"type": "generateMcpContracts",
"version": 1
},
"runOnCreate": true
}
]
}
- Optional: datasource
subscriptionFilter— on a Business Entity JSON, mirror the same filter shape when generation inputs must be constrained per entity (role keys, include/exclude system kinds). - Validate, then upload:
aifabrix validate <systemKey>
aifabrix upload <systemKey> --probe
On publish/sync, the dataplane upserts subscription rows from subscriptions[]. When runOnCreate: true, the task runs once after that upsert.
Defaults and examples
| Practice | Reason |
|---|---|
One key per business trigger |
Stable audit and safer diffs |
Filter by resourceTypes |
Avoids firing on every entity on the system |
Prefer platform.datasource.published for generators |
Matches Enterprise MCP lifecycle |
runOnCreate: true for bootstrap |
Ensures first publish materializes contracts |
task.version: 1 |
Explicit audit snapshot |
Minimal required shape (fails validate without task.type):
{
"key": "compile-com-on-system-publish",
"event": "platform.externalSystem.published",
"task": {
"type": "compileCom",
"version": 1
}
}
Validate
aifabrix validate <systemKey>
aifabrix upload <systemKey> --probe
aifabrix show <systemKey> --online
Confirm:
validateacceptstask.typeandkeypattern.- After upload/publish, subscription rows exist for the system (Subscriptions UI or online show, when available).
- Publishing a matching Business Entity (same
resourceType) triggers the intended generator task whenrunOnCreateor the event path is live.
Common mistakes
| Mistake | Fix |
|---|---|
task.type: roleAssistantTask |
Use an allowed platform type from the table above |
event: platform.record.updated |
Use record.update |
Vendor event names in event |
Use platform.* / record.* / schedule.* only |
Empty filter on a busy system |
Narrow resourceTypes or datasourceKeys |
Filter token ≠ entity resourceType |
Align catalog tokens on the Business Entity root |
Expecting field conditions (after.status) in schema |
Removed from validated DSL — do not put conditions on the entry |
| Relying on repair to invent subscriptions | Author subscriptions[] explicitly |
Limits
Subscriptions bootstrap platform compile/generate tasks declared in the external-system schema. They do not replace Business Entity sync, protection, or Role Assistant channel install. Experimental fields such as runDigitalWorkerTask, per-entry conditions, triggerPolicy, and deduplicationKeyTemplate were removed from the validated schema — omit them so aifabrix validate stays green. Builder help topic subscriptionGuide may still mention older narrative; when in doubt, follow the task.type enum and event names on this page. Schedule events require platform schedule support in the environment — start with platform.datasource.published for integrator builds. Document each subscription key in operator notes so publish logs map to business intent.