Skip to content

feat(company-os): useCompanyWorkflows composable, load, create, attach/detach, attachable options (#14409) #21240

Closed

Description

@mrveiss

Parent: #14409. Blocked by the backend issue #21239.

Problem

Nothing in the frontend lists, creates, or picks company workflows. Attach/detach calls live inline in the views, and a load failure is indistinguishable from an empty list.

Scope

New composable autobot-frontend/src/composables/llc/useCompanyWorkflows.ts:

  • load workflows with kind=workflow for a company;
  • create through the path-scoped route (maintainer decision 2026-11-09);
  • attach/detach moved here from the views;
  • attachable options (workflows not yet attached to the role);
  • state distinguishes failed from empty.
    Widen the path type in autobot-frontend/src/composables/llc/workflowPlanRequest.ts so it accepts the path-scoped workflow routes.

Acceptance criteria

  • useCompanyWorkflows.ts exposes load, create, attach, detach, attachable options
  • A failed load sets an explicit failed state, not an empty list
  • Create uses the path-scoped route and surfaces a 403 as a typed error
  • workflowPlanRequest path type widened; existing callers still type-check
  • No new direct fetch; uses the shared ApiClient
  • Log through the logger, no console.*

Tests

Vitest for the composable: loaded, failed, empty, create success/403, attach/detach, attachable filtering.

Activity

  1. added
    bugSomething isn't working
    area: company-osWave 4 · cluster A — Company OS & LLC canvas
    phase:M3.7Company OS, Automation and BI screens
    on Nov 9, 2026
  2. added
    needs-ac-evidenceClosed by a merge keyword; awaits an AC evidence table comment (#19520)
    on Nov 12, 2026
  3. github-actions commented on Nov 12, 2026

    @github-actions
    Contributor

    Landed via the merge train (#21394, merge 923b9e902e) via #21393

  4. mrveiss commented on Nov 12, 2026

    @mrveiss
    OwnerAuthor

    Landed in #21393 via merge train #21394, merge commit 923b9e902e on main, checked 2026-11-12 (Riga). Evidence below is read from main at that commit. CI of #21394 at its head: vue-tsc-baseline, frontend-tests, verify-types-run SUCCESS.

    AC Status Evidence
    Exposes load, create, attach, detach, attachable options met useCompanyWorkflows.ts:146 returns load, create, attach, detach, attachable
    Failed load sets explicit failed state met useCompanyWorkflows.ts load catch sets state='failed', workflows=[]; test "a thrown load is failed, never an empty ready list"
    Create uses path-scoped route; 403 typed met LIST='/api/llc/workflows/{company_id}'; WorkflowWriteError.forbidden = status === 403; test "create surfaces a 403 as a typed forbidden error"
    workflowPlanRequest path type widened, callers still type-check met workflowPlanRequest.ts:17-23 adds /api/llc/workflows/${string} and /api/llc/roles/${string}/workflows${string}; vue-tsc-baseline SUCCESS on #21394
    No new direct fetch, shared ApiClient met grep fetch|console. in the file: no match; uses useApiClient() + planRequest
    Logger, no console.* met createLogger('useCompanyWorkflows')

    All ACs delivered: stays closed. Note: "attachable" disables already-attached ids (disabled: on.has(id)) rather than omitting them; the AC wording is satisfied either way.

  5. removed
    needs-ac-evidenceClosed by a merge keyword; awaits an AC evidence table comment (#19520)
    on Nov 12, 2026
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 canvasbugSomething isn't workingfrontendphase:M3.7Company OS, Automation and BI screens

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions