docs: port workflow plugin documentation#13221
docs: port workflow plugin documentation#13221Yilialinn wants to merge 1 commit intoapache:masterfrom
Conversation
Port workflow plugin docs from API7 docs to APISIX with: - All three tabs (Admin API, ADC, Ingress Controller) - EN and ZH translations - Removed enterprise-only limit-count-advanced section - 3 example sections: conditional return, rate limiting by URI/query, rate limiting by consumers
There was a problem hiding this comment.
Pull request overview
Ports and expands the workflow plugin documentation into the APISIX docs, providing configuration examples across multiple delivery methods and keeping English/Chinese content aligned.
Changes:
- Added multi-tab examples for Admin API, ADC, and Ingress Controller (Gateway API / APISIX CRD).
- Updated/standardized the Attributes tables and example narratives in both EN and ZH docs.
- Added per-consumer rate-limiting examples and updated
limit-countusage (e.g.,policy: local) in the examples.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| docs/en/latest/plugins/workflow.md | Adds Tabs-based examples (Admin API/ADC/AIC) and refines descriptions/attributes for the workflow plugin. |
| docs/zh/latest/plugins/workflow.md | Mirrors the EN documentation updates with Tabs-based examples and updated attribute descriptions in Chinese. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| <head> | ||
| <link rel="canonical" href="https://docs.api7.ai/hub/workflow" /> | ||
| </head> | ||
|
|
||
| import Tabs from '@theme/Tabs'; | ||
| import TabItem from '@theme/TabItem'; |
There was a problem hiding this comment.
import Tabs / import TabItem are placed after a <head>...</head> JSX block. MDX requires import/export declarations to be at the top of the document (before any JSX/Markdown content), otherwise compilation can fail. Please move these imports above the <head> block (or switch to a Head component inserted after the imports).
| | Name | Type | Required | Default | Valid values | Description | | ||
| |------|------|----------|---------|--------------|-------------| | ||
| | rules | array[object] | True | | | An array of one or more pairs of matching conditions and actions to be executed. | | ||
| | rules.case | array[array] | False | | | An array of one or more matching conditions in the form of [lua-resty-expr](https://github.com/api7/lua-resty-expr#operator-list). For example, `{"arg_name", "==", "json"}`. | |
There was a problem hiding this comment.
The rules.case schema supports both array items and string items (e.g., string operators like AND/OR in lua-resty-expr). The docs currently list the type as array[array], which is narrower than what APISIX accepts. Update the type (for example to array[array|string]) and/or clarify in the description that connector/operator strings are also allowed inside the case array.
| | rules.case | array[array] | False | | | An array of one or more matching conditions in the form of [lua-resty-expr](https://github.com/api7/lua-resty-expr#operator-list). For example, `{"arg_name", "==", "json"}`. | | |
| | rules.case | array[array|string] | False | | | An array of one or more matching conditions in the form of [lua-resty-expr](https://github.com/api7/lua-resty-expr#operator-list). Items can be condition arrays such as `{"arg_name", "==", "json"}` and connector/operator strings such as `AND` or `OR`. | |
| | 名称 | 类型 | 必选项 | 默认值 | 有效值 | 描述 | | ||
| |------|------|--------|--------|--------|------| | ||
| | rules | array[object] | 是 | | | 一对或多对匹配条件和要执行的操作组成的数组。 | | ||
| | rules.case | array[array] | 否 | | | 一个或多个匹配条件的数组,形式为 [lua-resty-expr](https://github.com/api7/lua-resty-expr#operator-list),例如 `{"arg_name", "==", "json"}`。 | |
There was a problem hiding this comment.
rules.case 在 APISIX 的 schema 中允许同时包含数组项和字符串项(例如 lua-resty-expr 中用于连接条件的字符串操作符)。当前文档把类型写成了 array[array],范围偏窄。建议将类型更新为更准确的形式(例如 array[array|string]),并在描述中补充说明 case 数组中也可以包含连接/操作符字符串。
| | rules.case | array[array] | 否 | | | 一个或多个匹配条件的数组,形式为 [lua-resty-expr](https://github.com/api7/lua-resty-expr#operator-list),例如 `{"arg_name", "==", "json"}`。 | | |
| | rules.case | array[array|string] | 否 | | | 一个或多个匹配条件的数组,形式为 [lua-resty-expr](https://github.com/api7/lua-resty-expr#operator-list),例如 `{"arg_name", "==", "json"}`。`case` 数组中的元素除了条件数组外,也可以包含用于连接条件的字符串操作符/连接符。 | |
| <head> | ||
| <link rel="canonical" href="https://docs.api7.ai/hub/workflow" /> | ||
| </head> | ||
|
|
||
| import Tabs from '@theme/Tabs'; | ||
| import TabItem from '@theme/TabItem'; |
There was a problem hiding this comment.
The MDX import statements come after a <head>...</head> JSX block. In MDX, import/export declarations must appear before any other content/JSX, otherwise the page may fail to compile. Move the import Tabs / import TabItem lines above the <head> block (or replace the raw <head> usage with a component placed after the imports).
Summary
workflowplugin documentation from API7 docs to APISIXlimit-count-advancedsectionRelated issue
https://github.com/api7/docs/issues/892