Appearance
Playbooks
Playbooks are standard operating procedures (SOPs) for OFM. Use calls.md for payload shape and required fields.
Surface availability (explicit)
- API Gateway: Available.
- Direct Lambda: Available (operator-only invitations and org status transitions).
- CLI: Available (
g3n ofm ..., API Gateway + operator direct Lambdas). - MCP: Available.
Playbook: Org bootstrap + facilities
Goal: Stand up an org with facilities, zones, and a sales channel so downstream services can operate.
Why this sequence:
- Invitations gate org creation.
- Facilities (physical/legal/logical) anchor inventory, sales, and fulfillment.
- Sales channels define market/locale context for channel-specific workflows.
Preconditions
- A verified UAS user + USM session.
- Operator access (IAM) for invitation creation and org verification, if required.
SOP (happy path)
- Create invitation (direct Lambda
invitationCreate).- Reason: controlled onboarding and anti-enumeration.
- Create org (
POST /ofm/org/create) with the invitation code.- Reason: establishes org identity and owner/member records.
- Verify org (operator direct Lambda
orgStatusSettoverified, if required).- Reason: unverified orgs are blocked from writes across the stack.
- Create cost centre (
POST /ofm/cost-centre/create) if needed.- Reason: enables cost attribution for downstream calls.
- Create physical + legal facilities (
POST /ofm/facility/physical/create,/facility/legal/create).- Reason: physical and legal facility records are inputs to logical facilities.
- Create logical facility (
POST /ofm/facility/logical/create).- Reason: logical facilities are used by stock, sales, and channel routing.
- Create zones (
POST /ofm/zone/create) under the logical facility.- Reason: zoning supports inventory placement and routing.
- Create sales channel (
POST /ofm/sales-channel/create) and optional config.- Reason: channels connect logical facilities to markets/locales.
- Resolve codes (
POST /ofm/resolve/*) to map codes → GUIDs.- Reason: downstream services often require GUIDs.
Outputs
- Verified org with facility hierarchy and at least one sales channel.
- Codes and GUIDs ready for downstream services.
Failure modes / remediation
invalid-code/code-generation-exhausted: adjust codes or patterns and retry.invalid-fsm-transition: re-check current status before changing.not-owner/forbidden: use an owner session or operator direct Lambda.org-access-blocked/org-write-blocked: verify org status (operator must setverifiedand ensure notfrozen).
Cross-service relationships
- UAS/USM: provide the user/session that owns the org.
- All org-scoped services consume OFM org/facility/sales-channel identifiers.
Playbook: Member onboarding + delegation
Goal: Add members, set roles, and optionally scope them to facilities.
Why this sequence:
- OFM uses a bound invite/accept handshake.
- Facility-scoped access requires explicit logical assignments.
Preconditions
- Owner session for the org.
- Invitee has a verified UAS user.
SOP (happy path)
- Invite member (
POST /ofm/member/invite/create).- Reason: registers the invite and captures intended roles.
- Accept invite (
POST /ofm/member/invite/accept) as the invitee.- Reason: binds the member to the org.
- Assign logical facility (
POST /ofm/member/assign-logical) if facility-scoped access is needed.- Reason: facility access is explicit and time-bound.
- Create team (
POST /ofm/team/create) and add members (POST /ofm/team/member/add) if grouping is needed.- Reason: teams are non-authoritative but help with workflow organization.
- Resolve membership (
POST /ofm/member/resolve) to confirm effective roles.- Reason: validates that the member is correctly scoped.
- Suspend or doom members as needed (
POST /ofm/member/state/set).- Reason: enforce access revocation when required.
Outputs
- Active members with correct roles and optional facility assignments.
Failure modes / remediation
invitation-expired/invitation-consumed: issue a new invite.duplicate-member: check existing membership withmember/list.invalid-session: re-issue a valid USM session.not-foundon org-scoped reads: treat as not associated (anti-enumeration); verify membership via owner or self-check.
Cross-service relationships
- USM: sessions for owners/members.
- Downstream services enforce membership using OFM
member/resolve.