Skip to content

docs: port workflow plugin documentation#13221

Open
Yilialinn wants to merge 1 commit intoapache:masterfrom
Yilialinn:docs/update-workflow
Open

docs: port workflow plugin documentation#13221
Yilialinn wants to merge 1 commit intoapache:masterfrom
Yilialinn:docs/update-workflow

Conversation

@Yilialinn
Copy link
Copy Markdown
Contributor

Summary

  • Port workflow plugin documentation from API7 docs to APISIX
  • Include all three tabs: Admin API, ADC, and Ingress Controller (Gateway API / APISIX CRD)
  • Add both EN and ZH translations
  • Remove enterprise-only limit-count-advanced section
  • 3 example sections: conditional HTTP status return, rate limiting by URI/query, rate limiting by consumers

Related issue

https://github.com/api7/docs/issues/892

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
@dosubot dosubot bot added size:XXL This PR changes 1000+ lines, ignoring generated files. doc Documentation things labels Apr 14, 2026
@kayx23 kayx23 requested a review from Copilot April 14, 2026 08:44
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

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-count usage (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.

Comment on lines 31 to +36
<head>
<link rel="canonical" href="https://docs.api7.ai/hub/workflow" />
</head>

import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
Copy link

Copilot AI Apr 14, 2026

Choose a reason for hiding this comment

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

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).

Copilot uses AI. Check for mistakes.
| 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"}`. |
Copy link

Copilot AI Apr 14, 2026

Choose a reason for hiding this comment

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

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.

Suggested change
| 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`. |

Copilot uses AI. Check for mistakes.
| 名称 | 类型 | 必选项 | 默认值 | 有效值 | 描述 |
|------|------|--------|--------|--------|------|
| rules | array[object] | 是 | | | 一对或多对匹配条件和要执行的操作组成的数组。 |
| rules.case | array[array] | 否 | | | 一个或多个匹配条件的数组,形式为 [lua-resty-expr](https://github.com/api7/lua-resty-expr#operator-list),例如 `{"arg_name", "==", "json"}`。 |
Copy link

Copilot AI Apr 14, 2026

Choose a reason for hiding this comment

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

rules.case 在 APISIX 的 schema 中允许同时包含数组项和字符串项(例如 lua-resty-expr 中用于连接条件的字符串操作符)。当前文档把类型写成了 array[array],范围偏窄。建议将类型更新为更准确的形式(例如 array[array|string]),并在描述中补充说明 case 数组中也可以包含连接/操作符字符串。

Suggested change
| 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` 数组中的元素除了条件数组外,也可以包含用于连接条件的字符串操作符/连接符|

Copilot uses AI. Check for mistakes.
Comment on lines 31 to +36
<head>
<link rel="canonical" href="https://docs.api7.ai/hub/workflow" />
</head>

import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
Copy link

Copilot AI Apr 14, 2026

Choose a reason for hiding this comment

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

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).

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

doc Documentation things size:XXL This PR changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants