---
url: /reference/resource/extensions/pcm-flow-workflow-action.md
---

# 工作流 - 动作

自动化动作扩展模块，允许在自动化工作流中添加自定义动作：

![image.png](../../../assets/ed8592239a039d7c1f3705b3fe2015579af534cf.png)

![image.png](../../../assets/fb8a2c6b339e50934514137243cbdb027edf7e14.png)

![image.png](../../../assets/42dd17459c5bb3d8381227b09760f9551c99ab9a.png)

![image.png](../../../assets/bf3a40c54f1dc1fb5ea3421b232950ff92e8b477.png)

## 配置

配置结构：

> 支持两种策略模式：fixed（固定模式）、user‑defined（用户自定义模式）；输入参数策略与动态数据策略可独立选择模式，支持混合搭配（例如：入参为 fixed，输出动态属性为 user‑defined）

* 固定模式：

```yaml
extensions []
├─ key (string) [Mandatory]
├─ target (string) [Mandatory]
├─ resolver {} [Mandatory]
├─ title (string | i18n) [Mandatory]
├─ icon (string) [Optional]
├─ description (string | i18n) [Optional]
├─ resource (string) [Mandatory]
├─ inputPolicy {} [Mandatory]
│  ├─ mode (string) [Mandatory]
│  └─ allowedTypes [] [Mandatory]
├─ inputSchema [] [Mandatory]
│  ├─ key (string) [Mandatory]
│  ├─ title (string | i18n) [Mandatory]
│  ├─ type (string) [Mandatory]
│  └─ required (boolean) [Mandatory]
├─ dynamicPropertyPolicy {} [Mandatory]
│  ├─ mode (string) [Mandatory]
│  └─ allowedTypes [] [Mandatory]
└─ dynamicPropertySchema [] [Mandatory]
   ├─ key (string) [Mandatory]
   ├─ title (string | i18n) [Mandatory]
   ├─ type (string) [Mandatory]
   └─ required (boolean) [Mandatory]
```

* 用户自定义模式：

```yaml
extensions []
├─ key (string) [Mandatory]
├─ target (string) [Mandatory]
├─ resolver {} [Mandatory]
├─ title (string | i18n) [Mandatory]
├─ icon (string) [Optional]
├─ description (string | i18n) [Optional]
├─ resource (string) [Mandatory]
├─ inputPolicy {} [Mandatory]
│  ├─ mode (string) [Mandatory]
│  ├─ allowedTypes (string) [Mandatory]
│  └─ maxFields (number) [Mandatory]
└─ dynamicPropertyPolicy {} [Mandatory]
   ├─ mode (string) [Mandatory]
   ├─ allowedTypes (string) [Mandatory]
   └─ maxFields (number) [Mandatory]
```

配置示例：

* 固定模式：

```yaml
extensions:
  - key: example-flow-workflow-action
    target: "pcm:flow:workflow:action"
    resolver:
      function: resolver
    title: Action title
    icon: "resource:example-resource/icons/icon.svg"
    description: A sample action
    resource: main
    inputPolicy:
      mode: fixed
      allowedTypes: [text]
    inputSchema:
      - key: inputSchema-key-1
        title: InputSchema title
        type: text
        required: true  
    dynamicPropertyPolicy:
      mode: fixed
      allowedTypes: [text]
    dynamicPropertySchema:
      - key: property-key-1
        title: Property title
        type: text
        required: false
```

* 用户自定义模式：

```yaml
extensions:
  - key: example-flow-workflow-action
    target: "pcm:flow:workflow:action"
    resolver:
      function: resolver
    title: Action title
    icon: "resource:main/icons/icon.svg"
    description: A sample action   
    resource: main
    inputPolicy:
      mode: user-defined
      allowedTypes: "*"
      maxFields: 16
    dynamicPropertyPolicy:
      mode: user-defined
      allowedTypes: "*"
      maxFields: 16
```

## 属性

## 扩展数据

当前模块可访问的扩展数据：

## 限制

每个扩展模块对应的数量限制：

## 桥接方法

当前扩展模块不支持以下桥接方法，详情请参考 [view](/reference/interface/bridge/view) 。
