Skip to content

feat(company-os): no UI can create or attach a company workflow, so the org-chart process nodes are unreachable through the product #14409

Open
5 of 6 issues completed

Description

@mrveiss

Summary

The LLC workflow chain is complete and tenant-scoped on the backend, and has no product surface. An operator using the UI cannot create a company-scoped workflow, cannot attach one to a role, and therefore cannot make the org-chart process nodes (#13963) show anything.

The API works. Nothing in the frontend calls it.

The backend chain that exists

Step Endpoint Handler
Create a company-scoped workflow POST /llc/workflows/{company_id} llc/api/workflows.py:103 → WorkflowService.create
Attach it to a role POST /llc/roles/{company_id}/{role_id}/workflows RoleWorkflowService, admin-gated
Read the process nodes GET /llc/companies/{company_id}/process-nodes added by #13963

All three are registered (llc/api/__init__.py:41,82) and correctly scoped.

The gap

  • No frontend view calls POST /llc/workflows/{company_id}.
  • No frontend view calls POST /llc/roles/{company_id}/{role_id}/workflows. RolesView.vue:120-130 renders the workflows array read-only — <li v-for="workflow in workflows"> — with no attach or create control.
  • The org-chart canvas therefore renders zero process nodes for every company, through the product, indefinitely.

This is the full-surface-no-sink shape inverted: the sink is built and correct, and there is no producer a user can reach.

Why it reads as working

The endpoint returns 200 {nodes: []} rather than an error, which is the correct response for a company with no attached workflows. There is no way to tell "none attached" from "cannot attach" by looking at the UI, so the feature appears functional and empty rather than unfinished.

Related but distinct

Pre-existing workflows are separately unreachable: services/workflow_redis_backfill.py:159 writes company_id=None for every backfilled row with the comment "unattributable — see module docstring", and _require_workflow rejects null-company rows. That reconciliation is #14210 step 2 and is not this issue. Even once it lands, the missing UI controls below are still required.

What is needed

  • A control in the LLC admin UI to create a company-scoped workflow (POST /llc/workflows/{company_id}).
  • An attach/detach control on the role detail view (POST / DELETE on /llc/roles/{company_id}/{role_id}/workflows), gated to company admins to match the backend.
  • Empty-state copy on the org chart that distinguishes "no workflows attached to this role" from "workflows exist but none are attached", so the difference is visible.
  • processOpensWorkflow already exists in all 11 locale files and is referenced by nothing — wire it here rather than adding another key.

Acceptance criteria

  • A company admin can create a workflow and attach it to a role entirely from the UI
  • The attached workflow appears as a process node on the org chart without an API call
  • Controls are hidden or disabled for non-admins, matching the backend gate
  • The empty state distinguishes "none attached" from "nothing attachable"
  • No new i18n key is added while processOpensWorkflow remains unused
  • Owner decision 2026-11-21: per-locale translation dropped; strings are i18n keys in the English locale with English fallback, translatable later.

Refs #13963, #14210, #13935

Re-scoped 2026-11-09

Attach/detach, org-chart gating, processOpensWorkflow and the process-node-opens-builder path already exist on main (see the status comment). Residual acceptance criteria:

  • A company admin can create a company workflow from the UI (path-scoped route), then attach it to a role, without typing an id
  • The legacy POST /llc/workflows/{company_id} delegates to the Company OS workflow service and is admin-gated
  • Attach pickers (role detail view and org chart) offer a list of attachable workflows instead of a free-text id
  • The role detail view hides mutation controls when viewer_can_manage is false, like the org chart
  • The org chart distinguishes "process nodes failed to load" from "none attached" and from "nothing attachable"
  • Owner decision 2026-11-21: per-locale translation dropped; strings are i18n keys in the English locale with English fallback, translatable later.
  • Touched controls use kit components
  • RolesView.vue and OrgChart.vue do not grow

Activity

  1. modified the milestones: Backlog, v0.13.0 on Sep 12, 2026
  2. mrveiss commented on Oct 18, 2026

    @mrveiss
    OwnerAuthor

    Sighting from a code sweep plus seeded live data (2026-10-18).

    Refs #18245 (Refined UI step 5c).

  3. changed the title [-]feat(llc): no UI can create or attach a company workflow, so the org-chart process nodes are unreachable through the product[/-] [+]feat(company-os): no UI can create or attach a company workflow, so the org-chart process nodes are unreachable through the product[/+] on Oct 30, 2026
  4. mrveiss commented on Nov 9, 2026

    @mrveiss
    OwnerAuthor

    Status at origin/main (re-verified 2026-11-09)

    Already shipped

    Item Evidence at origin/main
    Attach/detach on the role detail view autobot-frontend/src/views/llc/RolesView.vue:158-168 (RoleAttachmentPanel, @add="attachWorkflow", @remove="detachWorkflow"), handlers at :791-803
    Attach/detach on the org chart autobot-frontend/src/views/llc/OrgChart.vue:664-706 (POST/DELETE /api/llc/roles/{company}/{role}/workflows), form components/llc/OrgProcessAttachForm.vue, detach components/workflow/CanvasDetachButton.vue
    Server-derived admin gating on the org chart OrgChart.vue:77 (viewerCanManage from useCompanyMembers), used at :1211, :1235, :1402 (:detachable)
    processOpensWorkflow wired components/workflow/WorkflowCanvas.vue:354-355 (title and aria-label)
    Process node opens the builder OrgChart.vue:555 (router.push to automation-section with the workflow query key)

    Residual gap (3 items)

    1. Nothing in the UI creates a company workflow: no caller of /api/llc/workflows/ or /api/llc/company-os/workflows.
    2. No attachable list: attach is a free-text id (OrgProcessAttachForm.vue:61-68), and fetchProcessNodes folds a failure into [] (OrgChart.vue:605-608), so "failed" and "none attached" look the same.
    3. RolesView does not mirror the admin gate (header comment RolesView.vue:18-24 says controls are intentionally not hidden); the org chart does.

    Backend side of the same gap: two create implementations for one table. Legacy POST /llc/workflows/{company_id} (autobot-backend/llc/api/workflows.py:134) is not admin-gated; the Company OS create (autobot-backend/llc/api/company_os.py:164) is.

    Maintainer decisions, 2026-11-09

    • (Q2) The legacy path-scoped create delegates to the Company OS workflow service and becomes admin-gated. The UI uses the path-scoped route.
    • (Q4) The UI creates the workflow, then attaches it (no backend model change).
    • (Q5) RolesView hides mutation controls from viewer_can_manage, like the org chart.
    • (Q6) Only the controls this work touches move to kit components.

    Known limitation: a table-backed workflow opened from a process node shows "not found" in the runtime builder until #18432.

    Children are filed below as native sub-issues; the existing ACs stay unticked, since ticking needs end-to-end code evidence and the create path does not exist yet.

  5. mrveiss commented on Nov 9, 2026

    @mrveiss
    OwnerAuthor

    Child #21239 landed on main @ 4b5a1299da (train #21263, carrying #21246): legacy POST /llc/workflows/{company_id} now delegates to CompanyOsWorkflowService.create, is admin-gated, and carries kind / owner_role_id (autobot-backend/llc/api/workflows.py, tests in autobot-backend/llc/tests/test_workflows_legacy_create.py, api.ts regenerated). This covers the residual AC "The legacy POST /llc/workflows/{company_id} delegates to the Company OS workflow service and is admin-gated". #21240 is unblocked. The other residual ACs (UI create, attach pickers, role-detail gating) remain open.

  6. mrveiss commented on Nov 9, 2026

    @mrveiss
    OwnerAuthor

    Ticked the residual AC "legacy POST /llc/workflows/{company_id} delegates to the Company OS workflow service and is admin-gated" with evidence on main (landed via #21246 in train #21263):

    • autobot-backend/llc/api/workflows.py:151 — the legacy create calls _company_os().create(...).
    • autobot-backend/llc/services/company_os/workflows.py:57 — that create runs require_company_admin(session, company_id, actor).
    • autobot-backend/llc/tests/test_workflows_legacy_create.py:109 test_non_admin_is_refused_and_admin_creates (403 for a non-admin, 201 for an admin).
  7. github-actions commented on Nov 13, 2026

    @github-actions
    Contributor

    Landed via the merge train (#21475, merge 1ccdc9655d) via #21458

  8. mrveiss commented on Nov 13, 2026

    @mrveiss
    OwnerAuthor

    Landed in #21458 (merge 1ccdc96)

    PR keyword: Refs, so this issue stays open. The re-scoped section's residual criteria were checked against origin/main; the six original criteria above it are superseded by that re-scope and left as they were.

    Residual criterion Evidence Ticked
    Admin creates a company workflow from the UI, then attaches it, without typing an id components/llc/CompanyWorkflowCreateModal.vue (create then attach), RoleWorkflowsPanel.vue:183, OrgProcessAttachForm.vue:106; tests RoleWorkflowsPanel.test.ts:210, OrgChart.processMutation.test.ts:308 yes
    Legacy POST /llc/workflows/{company_id} delegates and is admin-gated already ticked before this pass yes (previous)
    Attach pickers offer a list RoleWorkflowsPanel.vue:157, OrgProcessAttachForm.vue:82 (BaseSelectMenu) yes
    Role detail view hides mutation controls when viewer_can_manage is false RoleWorkflowsPanel.vue:127,154,184; test RoleWorkflowsPanel.test.ts:150 yes
    Org chart distinguishes failed / none attached / nothing attachable components/llc/OrgProcessBanners.vue:34-37, views/llc/OrgChart.vue:633; tests OrgProcessBanners.test.ts:21,29,36 yes
    New strings in all locale files; kit components; views do not grow views shrank (RolesView.vue 1026 to 1015, OrgChart.vue 1442 to 1435) and the new controls use @autobot/ui kit components, but only en.json gained keys no: the every-locale-file part is deliberately unmet under the English-only locale policy (owner decision pending; see #21241, #21242)

    Remaining

    The locale criterion. Children #21241 and #21242 carry the detail.

  9. mrveiss commented on Nov 21, 2026

    @mrveiss
    OwnerAuthor

    Locale criteria amended (owner decision 2026-11-21); original criteria checked against origin/main @ d8cbd91925

    The 22 new keys (4 under llc.orgChart, en.json:9152-9155; 18 under llc.workflows, en.json:9508-9527) are all used through t(...) and defined in en.json. The per-key table is on #21241 and #21242.

    English fallback (verified at origin/main @ d8cbd91925):

    Criterion Evidence Ticked
    Admin creates and attaches a workflow from the UI components/llc/CompanyWorkflowCreateModal.vue:6,29 (create, then attach when a role is given), mounted at RoleWorkflowsPanel.vue:183 and OrgProcessAttachForm.vue:109 yes
    Attached workflow appears as a process node without an API call composables/llc/useOrgProcessAttachment.ts:47 reloads after a write; wired to reloadProcessNodes at views/llc/OrgChart.vue:217,608-611; test views/llc/__tests__/OrgChart.processMutation.test.ts:240 yes
    Controls hidden for non-admins RoleWorkflowsPanel.vue:44,127,154,184 (viewerCanManage); OrgChart.vue:82,1120,1155,1322 (canManageCompany); backend gate require_company_admin in autobot-backend/llc/services/company_os/workflows.py yes
    Empty state distinguishes none attached from nothing attachable components/llc/OrgProcessBanners.vue:30-40, mounted at OrgChart.vue:1140 yes
    No new key while processOpensWorkflow is unused it is used at components/workflow/WorkflowCanvas.vue:354-355 yes
    Locale criteria (both) amended to the owner decision; evidence above yes
    Views do not grow RolesView.vue 1026 lines before #21458, 1015 on main; OrgChart.vue 1442 before, 1362 on main yes
    Touched controls use kit components not met: the per-workflow detach control in the new components/llc/RoleWorkflowsPanel.vue:126-136 is a raw <button>, not the kit BaseButton that the same file imports at :18 no

    The compound residual criterion was split into its three parts so each carries its own evidence.

    Remaining

    Move the detach control in RoleWorkflowsPanel.vue:126-136 to a kit component. Left open for that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: company-osWave 4 · cluster A — Company OS & LLC canvasbackendbugSomething isn't workingfrontendphase:M3.7Company OS, Automation and BI screens

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions