---
id: CAP-PFM-INT-019
title: Reuse workflow recipes and working-time configuration
feature: FEAT-PFM-INT-06
product_area: platform
module: integrations
revision: 1
status: superseded
product_intent: proposed
implementation_evidence: observed
supersedes: []
source_sha:
  services-platform: ad3f6a6582843008ed0f5a17b131878d15829af1
  macroservice-libraries: 54536a441935c6e09fdb7f96f0bec71c52ba4e03
intent_sources:
  - 'services-platform:docs/proposals/application-processes-and-workflow-actions/14-decisions.md#D-03'
  - 'services-platform:docs/proposals/application-processes-and-workflow-actions/14-decisions.md#D-08'
purpose: Administrators reuse action and workflow recipes and define the working time used for schedules.
outcomes:
  - Saved recipes contain actions that pass configuration validation.
  - Provisioning supplies an initial working calendar for each workspace.
concepts:
  - CON-PFM-INT-006
actors:
  - ACT-PFM-022
  - ACT-PFM-006
surfaces:
  - api
preconditions: []
postconditions: []
permissions:
  - key: platform.workflow-actions.registry-read
    where_checked: api
    scope: tenant
  - key: platform.workflow-actions.templates-manage
    where_checked: api
    scope: tenant
  - key: platform.workflow-actions.calendars-manage
    where_checked: api
    scope: tenant
rules:
  - id: BR-CAP-PFM-INT-019-01
    proved_by: [ATS-PFM-INT-019-01, TST-PFM-INT-587, TST-PFM-INT-591, TST-PFM-INT-604]
    statement: >-
      Lists place Rhythm’s eight shipped action recipes and six workflow recipes first, identify them as
      shipped and refuse customer edits or deletion.
    kind: policy
    enforced_at:
      - api
      - service
    must_prove: true
    provenance: test
    source: >-
      services-platform:modules/workflow-actions/tests/integration/services/persistence/action-templates.integration.spec.js#refuses
      a replacement of one (405)
    origin: none
  - id: BR-CAP-PFM-INT-019-02
    proved_by: [ATS-PFM-INT-018-07, ATS-PFM-INT-019-02, TST-PFM-INT-591, TST-PFM-INT-600, TST-PFM-INT-605]
    statement: >-
      Recipe saves validate every action against active enabled registry types, host and trigger restrictions,
      current contract version, settings schema and configurator permissions, with workflow stages also
      checked against their contract.
    kind: validation
    enforced_at:
      - service
    must_prove: true
    provenance: test
    source: >-
      services-platform:modules/workflow-actions/tests/integration/services/persistence/action-templates.integration.spec.js#refuses
      a type that is declared and switched off
    origin: none
  - id: BR-CAP-PFM-INT-019-03
    proved_by: [ATS-PFM-INT-019-03, TST-PFM-INT-591]
    statement: >-
      Customer recipe identifiers are unique within the workspace, cannot use Rhythm’s reserved prefix and
      require the read version on replacement.
    kind: validation
    enforced_at:
      - service
    must_prove: true
    provenance: test
    source: >-
      services-platform:modules/workflow-actions/tests/integration/services/persistence/action-templates.integration.spec.js#refuses
      an id in Rhythm’s own prefix, which the configuration-id grammar reserves (400)
    origin: none
  - id: BR-CAP-PFM-INT-019-04
    proved_by: [ATS-PFM-INT-019-09, ATS-PFM-INT-020-10]
    statement: 'A recipe is copied into its using definition, so later template edits do not change that definition.'
    kind: policy
    enforced_at:
      - service
    must_prove: true
    provenance: documented
    source: >-
      services-platform:docs/workflow-actions/README.md#Workflow actions: Platform's part of the Workflow
      Action Engine
    origin: none
  - id: BR-CAP-PFM-INT-019-05
    proved_by: [ATS-PFM-INT-019-04, TST-PFM-INT-588, TST-PFM-INT-596]
    statement: >-
      Calendars require a valid IANA zone, distinct working weekdays, optional forward working hours and at
      most four hundred holidays; one default at most must be active and a new default atomically clears the
      previous one.
    kind: validation
    enforced_at:
      - service
      - database
    must_prove: true
    provenance: test
    source: >-
      services-platform:modules/workflow-actions/tests/integration/services/persistence/business-calendars.integration.spec.js#refuses
      more than 400 holidays
    origin: 'services-platform:docs/proposals/application-processes-and-workflow-actions/14-decisions.md#D-08'
  - id: BR-CAP-PFM-INT-019-06
    proved_by: [ATS-PFM-INT-019-05, TST-PFM-INT-590]
    statement: >-
      Provisioning gives a workspace a Monday-to-Friday, nine-to-five Standard week in its own zone with no
      holidays, uses the seed ledger once and does not recreate a user-deleted seed.
    kind: lifecycle
    enforced_at:
      - service
    must_prove: true
    provenance: test
    source: >-
      services-platform:modules/workflow-actions/tests/integration/services/maintenance/tenant-participant.integration.spec.js#gives
      the tenant Standard week in its own zone, as its default
    origin: 'services-platform:docs/proposals/application-processes-and-workflow-actions/14-decisions.md#D-08'
  - id: BR-CAP-PFM-INT-019-07
    proved_by: [ATS-PFM-INT-019-06, TST-PFM-INT-002]
    statement: >-
      Business-duration arithmetic uses the calendar’s zone, working days, hours and holidays, so two business
      days after Friday at four in the afternoon with Monday closed reaches Wednesday at the same time.
    kind: calculation
    enforced_at:
      - service
    must_prove: true
    provenance: test
    source: >-
      macroservice-libraries:packages/workflow-actions/src/business-days.spec.ts#P2D business from a Friday
      16:00 with a Monday holiday lands on Wednesday 16:00, across the DST change (08 §10 case 8)
    origin: 'services-platform:docs/proposals/application-processes-and-workflow-actions/14-decisions.md#D-08'
  - id: BR-CAP-PFM-INT-019-08
    proved_by: []
    statement: Calendar changes leave previously calculated timer dates unchanged.
    kind: policy
    enforced_at:
      - service
    must_prove: true
    provenance: documented
    source: 'services-platform:docs/workflow-actions/README.md#How a host reads a calendar'
    origin: 'services-platform:docs/proposals/application-processes-and-workflow-actions/14-decisions.md#D-08'
  - id: BR-CAP-PFM-INT-019-09
    proved_by: [ATS-PFM-INT-019-07, TST-PFM-INT-587]
    statement: >-
      Registry read permits recipe and calendar reads, templates manage permits recipe changes and calendars
      manage permits calendar changes.
    kind: permission
    enforced_at:
      - api
    must_prove: true
    provenance: test
    source: >-
      services-platform:modules/workflow-actions/tests/e2e/workflow-actions.e2e.spec.js#refuses a caller
      without templates-manage a write (403)
    origin: none
  - id: BR-CAP-PFM-INT-019-10
    proved_by: [ATS-PFM-INT-019-08]
    statement: >-
      A workspace holds no more than one hundred calendars; stale replacements and applicable locked mutations
      refuse without changes, while deletion of the sole unlocked default can leave no default.
    kind: validation
    enforced_at:
      - service
    must_prove: true
    provenance: observed
    source: >-
      services-platform:modules/workflow-actions/services/persistence/business-calendars.ts:createBusinessCalendar
    origin: none
scenarios:
  - id: SC-CAP-PFM-INT-019-01
    given: The working calendar closes weekends and a Monday holiday.
    when: A reminder adds two business days to Friday at four in the afternoon.
    then: The reminder falls on Wednesday at four in the afternoon.
    provenance: test
    source: >-
      macroservice-libraries:packages/workflow-actions/src/business-days.spec.ts#P2D business from a Friday
      16:00 with a Monday holiday lands on Wednesday 16:00, across the DST change (08 §10 case 8)
edge_cases: []
constraints: []
depends_on:
  - CAP-PFM-INT-018
related:
  - CAP-PFM-INT-020
journeys: []
open_questions: []
evidence:
  - >-
    services-platform source inventory: modules/workflow-actions/services/persistence/action-templates.ts,
    workflow-templates.ts, business-calendars.ts, services/validation/action-lists.ts,
    contracts/workflow-template-document.ts, services/maintenance/*; rule-level automated test references;
    docs/workflow-actions/README.md; 14-decisions.md (D-03, D-08).
  - >-
    macroservice-libraries source inventory: packages/workflow-actions/src/business-days.ts; associated unit
    test.
  - >-
    Operation coverage: listWorkflowActionTemplates, createWorkflowActionTemplate, getWorkflowActionTemplate,
    replaceWorkflowActionTemplate, deleteWorkflowActionTemplate, listWorkflowTemplates,
    createWorkflowTemplate, getWorkflowTemplate, replaceWorkflowTemplate, deleteWorkflowTemplate,
    listBusinessCalendars, createBusinessCalendar, getBusinessCalendar, replaceBusinessCalendar,
    deleteBusinessCalendar.
  - >-
    Persistent record coverage: action_templates, shipped_action_templates, workflow_templates,
    shipped_workflow_templates, business_calendars.
  - 'End-to-end definition inventory: workflow-actions.e2e.spec.js.'
controls: [TC-AVL-004, TC-AZ-001, TC-AZ-002, TC-AZ-003, TC-AZ-004, TC-CHG-001, TC-CHG-002, TC-CHG-003, TC-CHG-004, TC-CHG-005, TC-CHG-006, TC-DAT-001, TC-DAT-003, TC-DAT-004, TC-IAM-001, TC-IAM-006, TC-LOG-004, TC-LOG-005, TC-PI-001, TC-PI-002, TC-PI-003, TC-PI-004, TC-PI-005, TC-TEN-001, TC-TEN-002, TC-TEN-003, TC-VEN-001, TC-VEN-002, TC-VEN-003]
exercised_by: [FAS-PFM-INT-06-01]
suites: [TST-PFM-INT-002, TST-PFM-INT-587, TST-PFM-INT-588, TST-PFM-INT-590, TST-PFM-INT-591, TST-PFM-INT-596, TST-PFM-INT-600, TST-PFM-INT-604, TST-PFM-INT-605]
---
# Reuse workflow recipes and working-time configuration

## Purpose

Administrators reuse action and workflow recipes and define the working time used for schedules.

## How It Works

An administrator chooses a shipped recipe or saves a reusable workspace recipe. The action registry checks whether its contents can be configured in the intended host. Copying a recipe lets a definition keep its own frozen configuration. Staff also describe the working calendar that gives business-duration schedules meaning. Provisioning supplies an initial calendar rather than assumes every customer must retain it. Calendar replacement protects concurrent edits and changes the default atomically when requested. Existing timers keep the dates already calculated for them. There is no connected console for this configuration yet. The product should expose recipe reuse and working-time setup as distinct choices within the workflow configuration experience.

## Relationships

- Requires keep the action builder aligned with deployed applications to supply the prerequisite configuration or operation.
- Connects with publish event-driven automation and follow its work through shared integration records.
