Skip to content

Add workflow API docs.#6033

Merged
Malith-19 merged 2 commits intowso2:masterfrom
Malith-19:add-workflow-apis
Apr 3, 2026
Merged

Add workflow API docs.#6033
Malith-19 merged 2 commits intowso2:masterfrom
Malith-19:add-workflow-apis

Conversation

@Malith-19
Copy link
Copy Markdown
Contributor

@Malith-19 Malith-19 commented Apr 3, 2026

Purpose

  • $subject

Related Issues

Test environment

Security checks

Summary by CodeRabbit

  • New Features

    • Added Workflow Management API: create, list, retrieve, update, delete workflows and associations; manage workflow instances (list, retrieve, delete, abort); discovery of workflow engines. Supports pagination, filtering, and scoped access controls.
  • Documentation

    • Published user-facing API reference pages for Workflow Management across product editions.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 3, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: f7792fbc-1fd8-40e7-aa38-710462019e55

📥 Commits

Reviewing files that changed from the base of the PR and between 9333730 and 1d10d25.

📒 Files selected for processing (3)
  • en/asgardeo/docs/apis/workflow-rest-api.md
  • en/identity-server/7.2.0/docs/apis/workflow-rest-api.md
  • en/identity-server/next/docs/apis/workflow-rest-api.md
✅ Files skipped from review due to trivial changes (3)
  • en/identity-server/next/docs/apis/workflow-rest-api.md
  • en/identity-server/7.2.0/docs/apis/workflow-rest-api.md
  • en/asgardeo/docs/apis/workflow-rest-api.md

Walkthrough

Adds OpenAPI 3.0 REST API specifications and Redoc documentation for Workflow Management across Asgardeo and WSO2 Identity Server (7.2.0 and next), introducing endpoints for workflows, workflow associations, workflow instances, and workflow engines with pagination, filtering, and security schemes.

Changes

Cohort / File(s) Summary
Asgardeo Workflow API
en/asgardeo/docs/apis/restapis/workflow.yaml
New OpenAPI 3.0 spec adding endpoints under /api/server/v1 for workflows, workflow-associations, workflow-instances, and workflow-engines; CRUD and lifecycle operations, pagination/filter parameters, OAuth2 scopes, and comprehensive component schemas/responses.
Asgardeo Documentation & Nav
en/asgardeo/docs/apis/workflow-rest-api.md, en/asgardeo/mkdocs.yml
Added a Redoc-rendered documentation page referencing the new YAML and a navigation entry under Management APIs.
Identity Server 7.2.0 Workflow API
en/identity-server/7.2.0/docs/apis/restapis/workflow.yaml
New OpenAPI 3.0 spec for tenant-scoped server URL with endpoints for workflows, associations, instances, and engines; includes OAuth2 and BasicAuth security, reusable parameters, component schemas, and standard responses.
Identity Server 7.2.0 Docs & Nav
en/identity-server/7.2.0/docs/apis/workflow-rest-api.md, en/identity-server/7.2.0/mkdocs.yml
Added Redoc documentation page and navigation entry for Workflow Management API.
Identity Server Next Workflow API
en/identity-server/next/docs/apis/restapis/workflow.yaml
New OpenAPI 3.0 spec mirroring workflow management endpoints with tenant-scoped server URL, security schemes, comprehensive schemas, and reusable parameters/responses.
Identity Server Next Docs & Nav
en/identity-server/next/docs/apis/workflow-rest-api.md, en/identity-server/next/mkdocs.yml
Added Redoc documentation page and navigation entry for Workflow Management API.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Poem

🐰 I nibble YAML lines with glee,

Workflows hop from tree to tree,
Endpoints sprout and docs shine bright,
Tenants dance in OAuth light,
☁️ Hooray — APIs take flight!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The PR title 'Add workflow API docs' directly summarizes the main change - adding documentation for workflow REST APIs across multiple Asgardeo and Identity Server versions.
Description check ✅ Passed The PR description follows the template structure with Purpose, Related Issues, Test environment, and Security checks sections, though Purpose contains placeholder text and Test environment lacks specific details.
Linked Issues check ✅ Passed The PR fully addresses issue #27396 by adding comprehensive workflow REST API documentation (OpenAPI specifications and markdown pages) for IS-7.2.0, Asgardeo, and IS-next versions.
Out of Scope Changes check ✅ Passed All changes are scoped to workflow API documentation additions (OpenAPI specs, markdown pages, and navigation updates) with no unrelated modifications detected.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 8

🧹 Nitpick comments (3)
en/identity-server/7.2.0/docs/apis/restapis/workflow.yaml (3)

5-5: Use "REST" (all caps) for the acronym.

The title uses "Rest API" but the standard capitalization for this acronym is "REST API".

Suggested fix
-  title: WSO2 Identity Server - Workflow Rest API
+  title: WSO2 Identity Server - Workflow REST API
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@en/identity-server/7.2.0/docs/apis/restapis/workflow.yaml` at line 5, Update
the YAML title value that currently reads "WSO2 Identity Server - Workflow Rest
API" to use the correct acronym capitalization "REST" so it becomes "WSO2
Identity Server - Workflow REST API"; locate and edit the title key in
workflow.yaml (the line with title: WSO2 Identity Server - Workflow Rest API) to
replace "Rest" with "REST".

593-600: Consider adding pagination for workflow engines endpoint.

Unlike other list endpoints (/workflows, /workflow-associations, /workflow-instances), the /workflow-engines endpoint returns an unbounded array without pagination parameters. If the number of workflow engines can grow, consider adding limit and offset parameters for consistency.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@en/identity-server/7.2.0/docs/apis/restapis/workflow.yaml` around lines 593 -
600, The /workflow-engines operation currently returns an unbounded array of
WorkflowEngine items; add pagination by introducing query parameters `limit`
(integer) and `offset` (integer) to the operation and change the 200 response
schema from an array of `WorkflowEngine` to a paginated object (e.g., `{ total:
integer, items: array of WorkflowEngine }` or a new `WorkflowEngineList`
component) so callers receive `items` plus a `total`/`count`; update the OpenAPI
components with the new `WorkflowEngineList` schema and reference it from the
response for the `/workflow-engines` endpoint.

462-483: Consider using reusable parameters for consistency.

The workflow instances endpoints define limit, offset, filter, and instance_id parameters inline, while other endpoints use $ref to reusable parameters (e.g., limitQueryParam, offsetQueryParam). Consider extracting instance_id to a reusable instanceIdPathParam in components/parameters for consistency.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@en/identity-server/7.2.0/docs/apis/restapis/workflow.yaml` around lines 462 -
483, Inline query/path parameters (limit, offset, filter, instance_id) are used
in the workflow instances paths instead of reusing existing parameter
definitions; extract the instance_id path parameter into a reusable components
parameter (suggested name: instanceIdPathParam) under components/parameters and
replace the inline instance_id usage with a $ref to that parameter; also align
the limit and offset to use the existing limitQueryParam and offsetQueryParam
(and consider adding a reusable filterQueryParam if desired) so the workflow
endpoints reference limitQueryParam, offsetQueryParam, and instanceIdPathParam
instead of defining them inline.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@en/asgardeo/docs/apis/restapis/workflow.yaml`:
- Line 468: Update the OpenAPI operation summary that currently reads "Get
workflow instances for a tenant" to use Asgardeo terminology by replacing
"tenant" with "organization" (e.g., change the summary in workflow.yaml from
"Get workflow instances for a tenant" to "Get workflow instances for an
organization") so the contract remains organization-scoped and consistent with
Asgardeo terms.
- Around line 383-387: The documented scope for the "Delete a specific workflow
association" operation is incorrect: it currently lists
internal_workflow_association_view (read scope) which will cause authorization
failures for deletions; update the description block for the delete operation to
require the correct delete scope (e.g., internal_workflow_association_delete)
wherever internal_workflow_association_view is referenced in that operation's
description or security requirements so the spec advertises the proper
permission for the delete endpoint.
- Around line 87-105: The examples violate the schema: OptionDetails.values is
string[] and the Operation enum doesn't include UPDATE_ROLE; update all sample
occurrences (e.g., the step options block using OptionDetails.values and the
association example referencing operation) to match the contract by converting
numeric scalars to quoted strings (e.g., "123", "124", "234", "235") and replace
any invalid operation tokens (like UPDATE_ROLE) with a valid Operation enum
value defined in the spec, and apply the same fixes to the other example blocks
the reviewer noted so examples are consistent with OptionDetails.values and
Operation.

In `@en/identity-server/7.2.0/docs/apis/restapis/workflow.yaml`:
- Around line 369-372: The DELETE operation's scope is incorrect: change the
scope string in the delete workflow association operation from
"internal_workflow_association_view" to the appropriate delete scope (consistent
with other deletes, e.g., use "internal_workflow_association_delete" or the
existing "internal_workflow_delete" used by deleteWorkflowById) so the operation
requires a _delete scope instead of the _view scope; update the scope entry for
the DELETE operation in the workflow association operation definition
accordingly.
- Around line 433-438: The 401/403/409 response entries in workflow.yaml
incorrectly use description: with reference strings; change each to use a $ref
mapping instead (e.g., replace the "401"/"403"/"409" response blocks that
currently have description:
"#/components/responses/Unauthorized|Forbidden|Conflict" with a $ref:
"#/components/responses/Unauthorized|Forbidden|Conflict" entry) so the responses
reference the components properly for OpenAPI rendering; update the blocks for
"401", "403", and "409" accordingly.
- Around line 956-961: The YAML currently defines requestParameters and
properties as siblings; fix by nesting properties under requestParameters so the
schema reads requestParameters -> type -> properties -> items -> $ref; update
the indentation for the block containing properties, type, items and the "$ref:
'#/components/schemas/Property'" so they are children of requestParameters (or
replace properties with additionalProperties referencing the same $ref if
dynamic key-value pairs are intended).

In `@en/identity-server/next/docs/apis/restapis/workflow.yaml`:
- Around line 92-110: The examples under template (notificationsForApprovers,
steps, etc.) contradict the schema: OptionDetails.values is defined as string[]
but the sample uses numeric scalars (e.g., 123, 124, 234, 235), and the
association examples reference an operation named UPDATE_ROLE which is not in
the Operation enum; fix by making the examples conform to the contract—either
change those numeric literals to quoted strings (e.g., "123") to match
OptionDetails.values or update the schema/type of OptionDetails.values to accept
numbers, and replace any invalid operation names (e.g., UPDATE_ROLE) in the
examples with one of the declared Operation values (or add UPDATE_ROLE to the
Operation enum if intended); update all occurrences mentioned (the current block
plus the ranges called out: 182-198, 220-236, 294-298) so examples and schema
are consistent.
- Around line 388-392: The OpenAPI doc for the association DELETE operation
currently lists the wrong scope ("internal_workflow_association_view"); update
the description in workflow.yaml for the delete endpoint to require the delete
scope instead—replace `internal_workflow_association_view` with the correct
deletion scope (e.g., `internal_workflow_association_delete`) so the documented
<b>Scope required:</b> matches authorization logic for association deletion.

---

Nitpick comments:
In `@en/identity-server/7.2.0/docs/apis/restapis/workflow.yaml`:
- Line 5: Update the YAML title value that currently reads "WSO2 Identity Server
- Workflow Rest API" to use the correct acronym capitalization "REST" so it
becomes "WSO2 Identity Server - Workflow REST API"; locate and edit the title
key in workflow.yaml (the line with title: WSO2 Identity Server - Workflow Rest
API) to replace "Rest" with "REST".
- Around line 593-600: The /workflow-engines operation currently returns an
unbounded array of WorkflowEngine items; add pagination by introducing query
parameters `limit` (integer) and `offset` (integer) to the operation and change
the 200 response schema from an array of `WorkflowEngine` to a paginated object
(e.g., `{ total: integer, items: array of WorkflowEngine }` or a new
`WorkflowEngineList` component) so callers receive `items` plus a
`total`/`count`; update the OpenAPI components with the new `WorkflowEngineList`
schema and reference it from the response for the `/workflow-engines` endpoint.
- Around line 462-483: Inline query/path parameters (limit, offset, filter,
instance_id) are used in the workflow instances paths instead of reusing
existing parameter definitions; extract the instance_id path parameter into a
reusable components parameter (suggested name: instanceIdPathParam) under
components/parameters and replace the inline instance_id usage with a $ref to
that parameter; also align the limit and offset to use the existing
limitQueryParam and offsetQueryParam (and consider adding a reusable
filterQueryParam if desired) so the workflow endpoints reference
limitQueryParam, offsetQueryParam, and instanceIdPathParam instead of defining
them inline.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 60245757-f6be-43fe-babf-d3d2d0f56565

📥 Commits

Reviewing files that changed from the base of the PR and between c3dbfbb and 9333730.

📒 Files selected for processing (9)
  • en/asgardeo/docs/apis/restapis/workflow.yaml
  • en/asgardeo/docs/apis/workflow-rest-api.md
  • en/asgardeo/mkdocs.yml
  • en/identity-server/7.2.0/docs/apis/restapis/workflow.yaml
  • en/identity-server/7.2.0/docs/apis/workflow-rest-api.md
  • en/identity-server/7.2.0/mkdocs.yml
  • en/identity-server/next/docs/apis/restapis/workflow.yaml
  • en/identity-server/next/docs/apis/workflow-rest-api.md
  • en/identity-server/next/mkdocs.yml

Comment on lines +87 to +105
notificationsForInitiator:
channels: ["email", "sms"]
events: ["onApproval", "onRejection"]
template:
name: MultiStepApprovalTemplate
notificationsForApprovers:
channels: ["email", "sms"]
events: ["onAssignment", "onRelease"]
steps:
- step: 1
options:
- entity: roles
values:
- 123
- 124
- entity: users
values:
- 234
- 235
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Keep the examples consistent with the contract.

OptionDetails.values is defined as string[], but these examples use numeric scalars, and the association example uses UPDATE_ROLE, which is not listed in Operation. Either the schema or the samples need to change, otherwise the spec is self-contradictory and the rendered examples will mislead callers.

Also applies to: 177-193, 215-231, 289-293

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@en/asgardeo/docs/apis/restapis/workflow.yaml` around lines 87 - 105, The
examples violate the schema: OptionDetails.values is string[] and the Operation
enum doesn't include UPDATE_ROLE; update all sample occurrences (e.g., the step
options block using OptionDetails.values and the association example referencing
operation) to match the contract by converting numeric scalars to quoted strings
(e.g., "123", "124", "234", "235") and replace any invalid operation tokens
(like UPDATE_ROLE) with a valid Operation enum value defined in the spec, and
apply the same fixes to the other example blocks the reviewer noted so examples
are consistent with OptionDetails.values and Operation.

Comment on lines +383 to +387
description: |
Delete a specific workflow association identified by the association ID.

<b>Scope required:</b> ``internal_workflow_association_view``

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Fix the scope documented for association deletion.

This delete endpoint currently advertises internal_workflow_association_view. Readers following the spec will request the read scope and hit authorization failures when they try to delete an association.

📝 Suggested fix
-        <b>Scope required:</b> ``internal_workflow_association_view``
+        <b>Scope required:</b> ``internal_workflow_association_delete``
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
description: |
Delete a specific workflow association identified by the association ID.
<b>Scope required:</b> ``internal_workflow_association_view``
description: |
Delete a specific workflow association identified by the association ID.
<b>Scope required:</b> ``internal_workflow_association_delete``
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@en/asgardeo/docs/apis/restapis/workflow.yaml` around lines 383 - 387, The
documented scope for the "Delete a specific workflow association" operation is
incorrect: it currently lists internal_workflow_association_view (read scope)
which will cause authorization failures for deletions; update the description
block for the delete operation to require the correct delete scope (e.g.,
internal_workflow_association_delete) wherever
internal_workflow_association_view is referenced in that operation's description
or security requirements so the spec advertises the proper permission for the
delete endpoint.

get:
tags:
- Workflow Instances Management
summary: Get workflow instances for a tenant
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Use Asgardeo terminology in this summary.

tenant is an Identity Server term, but this contract is organization-scoped. Keeping the summary aligned with Asgardeo terminology avoids mixing the two models on the same page.

📝 Suggested fix
-      summary: Get workflow instances for a tenant
+      summary: Get workflow instances for an organization
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
summary: Get workflow instances for a tenant
summary: Get workflow instances for an organization
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@en/asgardeo/docs/apis/restapis/workflow.yaml` at line 468, Update the OpenAPI
operation summary that currently reads "Get workflow instances for a tenant" to
use Asgardeo terminology by replacing "tenant" with "organization" (e.g., change
the summary in workflow.yaml from "Get workflow instances for a tenant" to "Get
workflow instances for an organization") so the contract remains
organization-scoped and consistent with Asgardeo terms.

Comment on lines +369 to +372
description: |
Delete a specific workflow association identified by the association ID.

<b>Scope required:</b> ``internal_workflow_association_view``
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Incorrect scope for DELETE operation.

The delete operation specifies internal_workflow_association_view scope, but DELETE operations typically require a _delete scope. Compare with line 225 where deleteWorkflowById uses internal_workflow_delete.

Proposed fix
       description: |
         Delete a specific workflow association identified by the association ID.

-        <b>Scope required:</b> ``internal_workflow_association_view``
+        <b>Scope required:</b> ``internal_workflow_association_delete``
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@en/identity-server/7.2.0/docs/apis/restapis/workflow.yaml` around lines 369 -
372, The DELETE operation's scope is incorrect: change the scope string in the
delete workflow association operation from "internal_workflow_association_view"
to the appropriate delete scope (consistent with other deletes, e.g., use
"internal_workflow_association_delete" or the existing
"internal_workflow_delete" used by deleteWorkflowById) so the operation requires
a _delete scope instead of the _view scope; update the scope entry for the
DELETE operation in the workflow association operation definition accordingly.

Comment on lines +433 to +438
"401":
description: "#/components/responses/Unauthorized"
"403":
description: "#/components/responses/Forbidden"
"409":
description: "#/components/responses/Conflict"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Incorrect response references: use $ref instead of description with reference paths.

The 401, 403, and 409 responses incorrectly use description: with reference strings instead of proper $ref: syntax. These responses will not render correctly in the API documentation.

Proposed fix
         "401":
-          description: "#/components/responses/Unauthorized"
+          $ref: "#/components/responses/Unauthorized"
         "403":
-          description: "#/components/responses/Forbidden"
+          $ref: "#/components/responses/Forbidden"
         "409":
-          description: "#/components/responses/Conflict"
-          content:
-            application/json:
-              schema:
-                $ref: "#/components/schemas/Error"
+          $ref: "#/components/responses/Conflict"
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"401":
description: "#/components/responses/Unauthorized"
"403":
description: "#/components/responses/Forbidden"
"409":
description: "#/components/responses/Conflict"
"401":
$ref: "#/components/responses/Unauthorized"
"403":
$ref: "#/components/responses/Forbidden"
"409":
$ref: "#/components/responses/Conflict"
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@en/identity-server/7.2.0/docs/apis/restapis/workflow.yaml` around lines 433 -
438, The 401/403/409 response entries in workflow.yaml incorrectly use
description: with reference strings; change each to use a $ref mapping instead
(e.g., replace the "401"/"403"/"409" response blocks that currently have
description: "#/components/responses/Unauthorized|Forbidden|Conflict" with a
$ref: "#/components/responses/Unauthorized|Forbidden|Conflict" entry) so the
responses reference the components properly for OpenAPI rendering; update the
blocks for "401", "403", and "409" accordingly.

Comment on lines +956 to +961
requestParameters:
type: object
properties:
type: array
items:
$ref: "#/components/schemas/Property"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Check if other workflow-related schemas in the codebase have similar patterns
rg -n "requestParameters|properties:" --type yaml -A2 -B2 en/identity-server/7.2.0/docs/apis/restapis/

Repository: wso2/docs-is

Length of output: 50369


🏁 Script executed:

sed -n '939,961p' en/identity-server/7.2.0/docs/apis/restapis/workflow.yaml | cat -A

Repository: wso2/docs-is

Length of output: 719


🏁 Script executed:

rg -n "requestParameters:" en/identity-server/7.2.0/docs/apis/restapis/ -A 3 -B 1

Repository: wso2/docs-is

Length of output: 511


🏁 Script executed:

rg -n "type: object" en/identity-server/7.2.0/docs/apis/restapis/workflow.yaml -A 2 | grep -A 2 "requestParameters\|requestBody" | head -20

Repository: wso2/docs-is

Length of output: 38


🏁 Script executed:

cat -n en/identity-server/7.2.0/docs/apis/restapis/workflow.yaml | sed -n '950,965p'

Repository: wso2/docs-is

Length of output: 537


🏁 Script executed:

# Check other object definitions in workflow.yaml to see the proper pattern
rg -n "type: object" en/identity-server/7.2.0/docs/apis/restapis/workflow.yaml -A 5 | head -40

Repository: wso2/docs-is

Length of output: 978


🏁 Script executed:

# Compare with a proper nested object structure - find examples of objects with nested properties
rg -n "type: object" en/identity-server/7.2.0/docs/apis/restapis/workflow.yaml -A 10 | grep -B 2 -A 8 "properties:" | head -60

Repository: wso2/docs-is

Length of output: 1643


🏁 Script executed:

# Let me check if there's a Property schema that should be items under requestParameters
sed -n '963,975p' en/identity-server/7.2.0/docs/apis/restapis/workflow.yaml

Repository: wso2/docs-is

Length of output: 289


🏁 Script executed:

# Check if there are similar patterns in verification-code-management.yaml that was flagged in the initial results
sed -n '128,138p' en/identity-server/7.2.0/docs/apis/restapis/verification-code-management.yaml

Repository: wso2/docs-is

Length of output: 295


🏁 Script executed:

# Check the exact indentation pattern for how objects with properties are properly nested
sed -n '615,630p' en/identity-server/7.2.0/docs/apis/restapis/workflow.yaml | cat -A

Repository: wso2/docs-is

Length of output: 592


🏁 Script executed:

# Now let's look at the full WorkflowInstanceResponse to understand intent
sed -n '939,962p' en/identity-server/7.2.0/docs/apis/restapis/workflow.yaml | cat -A

Repository: wso2/docs-is

Length of output: 721


🏁 Script executed:

# Verify the semantic intent - if requestParameters is type: object, what should its contents be?
# Check if there are any other requestParameters definitions in the codebase
rg -n "requestParameters" en/identity-server/7.2.0/docs/apis/restapis/ -B 2 -A 5

Repository: wso2/docs-is

Length of output: 780


Fix indentation: properties array should be nested under requestParameters object.

The properties field at line 958 is currently at the same indentation level as requestParameters (line 956), making them sibling properties. However, logically the array of Property objects should be contained within requestParameters.

Correct the indentation so properties is nested one level deeper under requestParameters:

Expected structure
requestParameters:
  type: object
  properties:
    type: array
    items:
      $ref: "#/components/schemas/Property"

Alternatively, use additionalProperties if requestParameters accepts dynamic key-value pairs:

requestParameters:
  type: object
  additionalProperties:
    $ref: "#/components/schemas/Property"
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@en/identity-server/7.2.0/docs/apis/restapis/workflow.yaml` around lines 956 -
961, The YAML currently defines requestParameters and properties as siblings;
fix by nesting properties under requestParameters so the schema reads
requestParameters -> type -> properties -> items -> $ref; update the indentation
for the block containing properties, type, items and the "$ref:
'#/components/schemas/Property'" so they are children of requestParameters (or
replace properties with additionalProperties referencing the same $ref if
dynamic key-value pairs are intended).

Comment on lines +92 to +110
notificationsForInitiator:
channels: ["email", "sms"]
events: ["onApproval", "onRejection"]
template:
name: MultiStepApprovalTemplate
notificationsForApprovers:
channels: ["email", "sms"]
events: ["onAssignment", "onRelease"]
steps:
- step: 1
options:
- entity: roles
values:
- 123
- 124
- entity: users
values:
- 234
- 235
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Keep the examples consistent with the contract.

OptionDetails.values is defined as string[], but these examples use numeric scalars, and the association example uses UPDATE_ROLE, which is not listed in Operation. Either the schema or the samples need to change, otherwise the spec is self-contradictory and the rendered examples will mislead callers.

Also applies to: 182-198, 220-236, 294-298

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@en/identity-server/next/docs/apis/restapis/workflow.yaml` around lines 92 -
110, The examples under template (notificationsForApprovers, steps, etc.)
contradict the schema: OptionDetails.values is defined as string[] but the
sample uses numeric scalars (e.g., 123, 124, 234, 235), and the association
examples reference an operation named UPDATE_ROLE which is not in the Operation
enum; fix by making the examples conform to the contract—either change those
numeric literals to quoted strings (e.g., "123") to match OptionDetails.values
or update the schema/type of OptionDetails.values to accept numbers, and replace
any invalid operation names (e.g., UPDATE_ROLE) in the examples with one of the
declared Operation values (or add UPDATE_ROLE to the Operation enum if
intended); update all occurrences mentioned (the current block plus the ranges
called out: 182-198, 220-236, 294-298) so examples and schema are consistent.

Comment on lines +388 to +392
description: |
Delete a specific workflow association identified by the association ID.

<b>Scope required:</b> ``internal_workflow_association_view``

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Fix the scope documented for association deletion.

This delete endpoint currently advertises internal_workflow_association_view. Readers following the spec will request the read scope and hit authorization failures when they try to delete an association.

📝 Suggested fix
-        <b>Scope required:</b> ``internal_workflow_association_view``
+        <b>Scope required:</b> ``internal_workflow_association_delete``
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
description: |
Delete a specific workflow association identified by the association ID.
<b>Scope required:</b> ``internal_workflow_association_view``
description: |
Delete a specific workflow association identified by the association ID.
<b>Scope required:</b> ``internal_workflow_association_delete``
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@en/identity-server/next/docs/apis/restapis/workflow.yaml` around lines 388 -
392, The OpenAPI doc for the association DELETE operation currently lists the
wrong scope ("internal_workflow_association_view"); update the description in
workflow.yaml for the delete endpoint to require the delete scope
instead—replace `internal_workflow_association_view` with the correct deletion
scope (e.g., `internal_workflow_association_delete`) so the documented <b>Scope
required:</b> matches authorization logic for association deletion.

@Malith-19 Malith-19 merged commit ddb3652 into wso2:master Apr 3, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add workflow rest apis to documentation

3 participants