# Workflows

## List Workflows

`TOOL discourse_list_workflows`

List compact Discourse Workflow summaries. Requires an admin API key.

Authentication: no security requirement declared for this operation.

Parameters:

- `filter` (argument, string, optional)
  Type: string

- `trigger_type` (argument, string, optional)
  Type: string

- `tags` (argument, Array<string>, optional)
  Type: Array<string>
  
  Items:
    Type: string

- `cursor` (argument, string, optional)
  Type: string

- `limit` (argument, integer, optional)
  Type: integer
  
  default: 25
  
  minimum: 1
  
  maximum: 100

- `exclude_id` (argument, string, optional)
  Type: string

## Examples

### JSON-RPC

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "discourse_list_workflows",
    "arguments": {
        "filter": "string",
        "trigger_type": "string",
        "tags": [
          "string"
        ],
        "cursor": "string",
        "limit": 25,
        "exclude_id": "string"
      }
  }
}
```

### TypeScript

```typescript
const result = await client.callTool({
  "name": "discourse_list_workflows",
  "arguments": {
    "filter": "string",
    "trigger_type": "string",
    "tags": [
      "string"
    ],
    "cursor": "string",
    "limit": 25,
    "exclude_id": "string"
  }
});
```

### Python

```python
result = await session.call_tool("discourse_list_workflows", arguments={
  "filter": "string",
  "trigger_type": "string",
  "tags": [
    "string"
  ],
  "cursor": "string",
  "limit": 25,
  "exclude_id": "string"
})
```


## Get Workflow

`TOOL discourse_get_workflow`

Get the complete round-trippable workflow graph. GET immediately before updating it.

Authentication: no security requirement declared for this operation.

Request body: application/json (required)

Type: object

- `id` (required)
  Type: string | integer
  
  Workflow ID
  
  anyOf:
    Type: string
    
    pattern: "^\\d+$"
  
    Type: integer
    
    exclusiveMinimum: 0

Additional properties: false

## Examples

### JSON-RPC

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "discourse_get_workflow",
    "arguments": {
        "id": "string"
      }
  }
}
```

### TypeScript

```typescript
const result = await client.callTool({
  "name": "discourse_get_workflow",
  "arguments": {
    "id": "string"
  }
});
```

### Python

```python
result = await session.call_tool("discourse_get_workflow", arguments={
  "id": "string"
})
```


## List Workflow Node Types

`TOOL discourse_list_workflow_node_types`

List a slim catalog, or pass identifier for schemas, ports, and output contracts. Authoring loop: inspect the slim node catalog, request identifiers for schemas and output keys, resolve entity ids, create from a template or complete graph, GET before edits, test the draft, then publish. Interpolating strings start with =. Filter/if use leftValue/rightValue and output ports true/false. Connection type is the source output key, not always main. Prefer declarative nodes over action:code. Manual runs execute the current draft. Omitting a node on whole-graph update deletes it. nodes and connections must always be sent together.

Authentication: no security requirement declared for this operation.

Parameters:

- `kind` (argument, string, optional)
  Type: string
  
  enum: ["trigger","action","condition","flow"]

- `identifier` (argument, string, optional)
  Type: string

- `manually_triggerable_only` (argument, boolean, optional)
  Type: boolean

## Examples

### JSON-RPC

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "discourse_list_workflow_node_types",
    "arguments": {
        "kind": "trigger",
        "identifier": "string",
        "manually_triggerable_only": true
      }
  }
}
```

### TypeScript

```typescript
const result = await client.callTool({
  "name": "discourse_list_workflow_node_types",
  "arguments": {
    "kind": "trigger",
    "identifier": "string",
    "manually_triggerable_only": true
  }
});
```

### Python

```python
result = await session.call_tool("discourse_list_workflow_node_types", arguments={
  "kind": "trigger",
  "identifier": "string",
  "manually_triggerable_only": true
})
```


## Resolve Workflow Entity

`TOOL discourse_resolve_workflow_entity`

Resolve category, tag, group, user, badge, chat channel, or data-table ids for workflow parameters.

Authentication: no security requirement declared for this operation.

Parameters:

- `kind` (argument, string, required)
  Type: string
  
  enum: ["category","tag","user","group","badge","data_table","chat_channel"]

- `query` (argument, string, required)
  Type: string
  
  minLength: 1

## Examples

### JSON-RPC

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "discourse_resolve_workflow_entity",
    "arguments": {
        "kind": "category",
        "query": "string"
      }
  }
}
```

### TypeScript

```typescript
const result = await client.callTool({
  "name": "discourse_resolve_workflow_entity",
  "arguments": {
    "kind": "category",
    "query": "string"
  }
});
```

### Python

```python
result = await session.call_tool("discourse_resolve_workflow_entity", arguments={
  "kind": "category",
  "query": "string"
})
```


## List Workflow Templates

`TOOL discourse_list_workflow_templates`

List templates or retrieve a complete template graph by id. Authoring loop: inspect the slim node catalog, request identifiers for schemas and output keys, resolve entity ids, create from a template or complete graph, GET before edits, test the draft, then publish. Interpolating strings start with =. Filter/if use leftValue/rightValue and output ports true/false. Connection type is the source output key, not always main. Prefer declarative nodes over action:code. Manual runs execute the current draft. Omitting a node on whole-graph update deletes it. nodes and connections must always be sent together.

Authentication: no security requirement declared for this operation.

Parameters:

- `id` (argument, string, optional)
  Type: string
  
  pattern: "^[a-z0-9_-]+$"

## Examples

### JSON-RPC

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "discourse_list_workflow_templates",
    "arguments": {
        "id": "string"
      }
  }
}
```

### TypeScript

```typescript
const result = await client.callTool({
  "name": "discourse_list_workflow_templates",
  "arguments": {
    "id": "string"
  }
});
```

### Python

```python
result = await session.call_tool("discourse_list_workflow_templates", arguments={
  "id": "string"
})
```


## List Workflow Executions

`TOOL discourse_list_workflow_executions`

List global or per-workflow execution history.

Authentication: no security requirement declared for this operation.

Request body: application/json (required)

Type: object

- `workflow_id` (optional)
  Type: string | integer
  
  anyOf:
    Type: string
    
    pattern: "^\\d+$"
  
    Type: integer
    
    exclusiveMinimum: 0

- `cursor` (optional)
  Type: string

- `limit` (optional)
  Type: integer
  
  default: 25
  
  minimum: 1
  
  maximum: 100

Additional properties: false

## Examples

### JSON-RPC

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "discourse_list_workflow_executions",
    "arguments": {
        "workflow_id": "string",
        "cursor": "string",
        "limit": 25
      }
  }
}
```

### TypeScript

```typescript
const result = await client.callTool({
  "name": "discourse_list_workflow_executions",
  "arguments": {
    "workflow_id": "string",
    "cursor": "string",
    "limit": 25
  }
});
```

### Python

```python
result = await session.call_tool("discourse_list_workflow_executions", arguments={
  "workflow_id": "string",
  "cursor": "string",
  "limit": 25
})
```


## Get Workflow Execution

`TOOL discourse_get_workflow_execution`

Poll an execution for status, errors, timing, trigger data, and steps.

Authentication: no security requirement declared for this operation.

Request body: application/json (required)

Type: object

- `id` (required)
  Type: string | integer
  
  Execution ID
  
  anyOf:
    Type: string
    
    pattern: "^\\d+$"
  
    Type: integer
    
    exclusiveMinimum: 0

Additional properties: false

## Examples

### JSON-RPC

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "discourse_get_workflow_execution",
    "arguments": {
        "id": "string"
      }
  }
}
```

### TypeScript

```typescript
const result = await client.callTool({
  "name": "discourse_get_workflow_execution",
  "arguments": {
    "id": "string"
  }
});
```

### Python

```python
result = await session.call_tool("discourse_get_workflow_execution", arguments={
  "id": "string"
})
```


## List Workflow Versions

`TOOL discourse_list_workflow_versions`

List workflow version history and UUIDs available for restore.

Authentication: no security requirement declared for this operation.

Request body: application/json (required)

Type: object

- `workflow_id` (required)
  Type: string | integer
  
  anyOf:
    Type: string
    
    pattern: "^\\d+$"
  
    Type: integer
    
    exclusiveMinimum: 0

Additional properties: false

## Examples

### JSON-RPC

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "discourse_list_workflow_versions",
    "arguments": {
        "workflow_id": "string"
      }
  }
}
```

### TypeScript

```typescript
const result = await client.callTool({
  "name": "discourse_list_workflow_versions",
  "arguments": {
    "workflow_id": "string"
  }
});
```

### Python

```python
result = await session.call_tool("discourse_list_workflow_versions", arguments={
  "workflow_id": "string"
})
```


## List Workflow Credentials

`TOOL discourse_list_workflow_credentials`

List workflow credentials with secrets redacted. Credential creation remains in the admin UI.

Authentication: no security requirement declared for this operation.

Parameters:

- `type` (argument, string, optional)
  Type: string

- `cursor` (argument, string, optional)
  Type: string

- `limit` (argument, integer, optional)
  Type: integer
  
  default: 25
  
  minimum: 1
  
  maximum: 100

## Examples

### JSON-RPC

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "discourse_list_workflow_credentials",
    "arguments": {
        "type": "string",
        "cursor": "string",
        "limit": 25
      }
  }
}
```

### TypeScript

```typescript
const result = await client.callTool({
  "name": "discourse_list_workflow_credentials",
  "arguments": {
    "type": "string",
    "cursor": "string",
    "limit": 25
  }
});
```

### Python

```python
result = await session.call_tool("discourse_list_workflow_credentials", arguments={
  "type": "string",
  "cursor": "string",
  "limit": 25
})
```


## Evaluate Workflow Expression

`TOOL discourse_evaluate_workflow_expression`

Evaluate a workflow expression without mutating the forum. Interpolating expressions start with =.

Authentication: no security requirement declared for this operation.

Request body: application/json (required)

Type: object

- `template` (required)
  Type: string

- `workflow_id` (optional)
  Type: string | integer
  
  anyOf:
    Type: string
    
    pattern: "^\\d+$"
  
    Type: integer
    
    exclusiveMinimum: 0

- `node_id` (optional)
  Type: string

Additional properties: false

## Examples

### JSON-RPC

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "discourse_evaluate_workflow_expression",
    "arguments": {
        "template": "string",
        "workflow_id": "string",
        "node_id": "string"
      }
  }
}
```

### TypeScript

```typescript
const result = await client.callTool({
  "name": "discourse_evaluate_workflow_expression",
  "arguments": {
    "template": "string",
    "workflow_id": "string",
    "node_id": "string"
  }
});
```

### Python

```python
result = await session.call_tool("discourse_evaluate_workflow_expression", arguments={
  "template": "string",
  "workflow_id": "string",
  "node_id": "string"
})
```


## Create Workflow

`TOOL discourse_create_workflow`

Create a draft from a complete small graph or template. Prefer a complete graph over blank creation. Authoring loop: inspect the slim node catalog, request identifiers for schemas and output keys, resolve entity ids, create from a template or complete graph, GET before edits, test the draft, then publish. Interpolating strings start with =. Filter/if use leftValue/rightValue and output ports true/false. Connection type is the source output key, not always main. Prefer declarative nodes over action:code. Manual runs execute the current draft. Omitting a node on whole-graph update deletes it. nodes and connections must always be sent together.

Authentication: no security requirement declared for this operation.

Request body: application/json (required)

Type: object

- `name` (required)
  Type: string
  
  minLength: 1

- `nodes` (optional)
  Type: Array<object>
  
  Items:
    Type: object
    
    - `id` (optional)
      Type: string
    
    - `type` (required)
      Type: string
      
      minLength: 1
    
    - `name` (required)
      Type: string
      
      minLength: 1
    
    - `parameters` (optional)
      Type: object
      
      Additional properties: 
        Type: any
    
    - `credentials` (optional)
      Type: object
      
      Additional properties: 
        Type: any
    
    - `position` (optional)
      Type: any
    
    Additional properties: true

- `connections` (optional)
  Type: Array<object> | object
  
  anyOf:
    Type: Array<object>
    
    Items:
      Type: object
      
      - `from` (required)
        Type: string
        
        minLength: 1
      
      - `to` (required)
        Type: string
        
        minLength: 1
      
      - `type` (optional)
        Type: string
        
        default: "main"
        
        minLength: 1
      
      - `output_index` (optional)
        Type: integer
        
        default: 0
        
        minimum: 0
      
      - `input_index` (optional)
        Type: integer
        
        default: 0
        
        minimum: 0
      
      Additional properties: false
  
    Type: object
    
    Additional properties: 
      Type: object
      
      Additional properties: 
        Type: Array<Array<object>>
        
        Items:
          Type: Array<object>
          
          Items:
            Type: object
            
            - `node` (required)
              Type: string
            
            - `type` (required)
              Type: string
            
            - `index` (required)
              Type: integer
              
              minimum: 0
            
            Additional properties: true

- `tags` (optional)
  Type: Array<string>
  
  Items:
    Type: string

- `static_data` (optional)
  Type: object
  
  Additional properties: 
    Type: any

- `template_id` (optional)
  Type: string
  
  pattern: "^[a-z0-9_-]+$"

Additional properties: false

## Examples

### JSON-RPC

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "discourse_create_workflow",
    "arguments": {
        "name": "string",
        "nodes": [
          {
            "id": "string",
            "type": "string",
            "name": "string",
            "parameters": {},
            "credentials": {}
          }
        ],
        "connections": [
          {
            "from": "string",
            "to": "string",
            "type": "main",
            "output_index": 0,
            "input_index": 0
          }
        ],
        "tags": [
          "string"
        ],
        "static_data": {},
        "template_id": "string"
      }
  }
}
```

### TypeScript

```typescript
const result = await client.callTool({
  "name": "discourse_create_workflow",
  "arguments": {
    "name": "string",
    "nodes": [
      {
        "id": "string",
        "type": "string",
        "name": "string",
        "parameters": {},
        "credentials": {}
      }
    ],
    "connections": [
      {
        "from": "string",
        "to": "string",
        "type": "main",
        "output_index": 0,
        "input_index": 0
      }
    ],
    "tags": [
      "string"
    ],
    "static_data": {},
    "template_id": "string"
  }
});
```

### Python

```python
result = await session.call_tool("discourse_create_workflow", arguments={
  "name": "string",
  "nodes": [
    {
      "id": "string",
      "type": "string",
      "name": "string",
      "parameters": {},
      "credentials": {}
    }
  ],
  "connections": [
    {
      "from": "string",
      "to": "string",
      "type": "main",
      "output_index": 0,
      "input_index": 0
    }
  ],
  "tags": [
    "string"
  ],
  "static_data": {},
  "template_id": "string"
})
```


## Update Workflow

`TOOL discourse_update_workflow`

GET first. A replace PUT replaces the whole draft graph; omitted nodes are deleted. Use complete nodes+connections or operations[], never both. Authoring loop: inspect the slim node catalog, request identifiers for schemas and output keys, resolve entity ids, create from a template or complete graph, GET before edits, test the draft, then publish. Interpolating strings start with =. Filter/if use leftValue/rightValue and output ports true/false. Connection type is the source output key, not always main. Prefer declarative nodes over action:code. Manual runs execute the current draft. Omitting a node on whole-graph update deletes it. nodes and connections must always be sent together.

Authentication: no security requirement declared for this operation.

Request body: application/json (required)

Type: object

- `id` (required)
  Type: string | integer
  
  anyOf:
    Type: string
    
    pattern: "^\\d+$"
  
    Type: integer
    
    exclusiveMinimum: 0

- `name` (optional)
  Type: string
  
  minLength: 1

- `tags` (optional)
  Type: Array<string>
  
  Items:
    Type: string

- `timezone` (optional)
  Type: string

- `error_workflow_id` (optional)
  Type: string | integer | null
  
  anyOf:
    Type: string | integer
    
    anyOf:
      Type: string
      
      pattern: "^\\d+$"
    
      Type: integer
      
      exclusiveMinimum: 0
  
    Type: null

- `static_data` (optional)
  Type: object
  
  Additional properties: 
    Type: any

- `published` (optional)
  Type: boolean

- `autosaved` (optional)
  Type: boolean

- `nodes` (optional)
  Type: Array<object>
  
  Items:
    Type: object
    
    - `id` (optional)
      Type: string
    
    - `type` (required)
      Type: string
      
      minLength: 1
    
    - `name` (required)
      Type: string
      
      minLength: 1
    
    - `parameters` (optional)
      Type: object
      
      Additional properties: 
        Type: any
    
    - `credentials` (optional)
      Type: object
      
      Additional properties: 
        Type: any
    
    - `position` (optional)
      Type: any
    
    Additional properties: true

- `connections` (optional)
  Type: Array<object> | object
  
  anyOf:
    Type: Array<object>
    
    Items:
      Type: object
      
      - `from` (required)
        Type: string
        
        minLength: 1
      
      - `to` (required)
        Type: string
        
        minLength: 1
      
      - `type` (optional)
        Type: string
        
        default: "main"
        
        minLength: 1
      
      - `output_index` (optional)
        Type: integer
        
        default: 0
        
        minimum: 0
      
      - `input_index` (optional)
        Type: integer
        
        default: 0
        
        minimum: 0
      
      Additional properties: false
  
    Type: object
    
    Additional properties: 
      Type: object
      
      Additional properties: 
        Type: Array<Array<object>>
        
        Items:
          Type: Array<object>
          
          Items:
            Type: object
            
            - `node` (required)
              Type: string
            
            - `type` (required)
              Type: string
            
            - `index` (required)
              Type: integer
              
              minimum: 0
            
            Additional properties: true

- `operations` (optional)
  Type: Array<object>
  
  minItems: 1
  
  Items:
    Type: object
    
    anyOf:
      Type: object
      
      - `op` (required)
        Type: string
        
        const: "add_node"
      
      - `id` (optional)
        Type: string
      
      - `node` (required)
        Type: object
        
        - `id` (optional)
          Type: string
        
        - `type` (required)
          Type: string
          
          minLength: 1
        
        - `name` (required)
          Type: string
          
          minLength: 1
        
        - `parameters` (optional)
          Type: object
          
          Additional properties: 
            Type: any
        
        - `credentials` (optional)
          Type: object
          
          Additional properties: 
            Type: any
        
        - `position` (optional)
          Type: any
        
        Additional properties: true
      
      Additional properties: false
    
      Type: object
      
      - `op` (required)
        Type: string
        
        const: "update_node_parameters"
      
      - `parameters` (required)
        Type: object
        
        Additional properties: 
          Type: any
      
      - `id` (optional)
        Type: string
      
      - `name` (optional)
        Type: string
      
      Additional properties: false
    
      Type: object
      
      - `op` (required)
        Type: string
        
        const: "rename_node"
      
      - `name` (required)
        Type: string
        
        minLength: 1
      
      - `id` (optional)
        Type: string
      
      - `current_name` (optional)
        Type: string
      
      Additional properties: false
    
      Type: object
      
      - `op` (required)
        Type: string
        
        const: "remove_node"
      
      - `id` (optional)
        Type: string
      
      - `name` (optional)
        Type: string
      
      Additional properties: false
    
      Type: object
      
      - `op` (required)
        Type: string
        
        const: "add_connection"
      
      - `from` (required)
        Type: string
        
        minLength: 1
      
      - `to` (required)
        Type: string
        
        minLength: 1
      
      - `type` (optional)
        Type: string
        
        default: "main"
        
        minLength: 1
      
      - `output_index` (optional)
        Type: integer
        
        default: 0
        
        minimum: 0
      
      - `input_index` (optional)
        Type: integer
        
        default: 0
        
        minimum: 0
      
      Additional properties: false
    
      Type: object
      
      - `op` (required)
        Type: string
        
        const: "remove_connection"
      
      - `from` (required)
        Type: string
        
        minLength: 1
      
      - `to` (required)
        Type: string
        
        minLength: 1
      
      - `type` (optional)
        Type: string
        
        minLength: 1
      
      - `output_index` (optional)
        Type: integer
        
        minimum: 0
      
      - `input_index` (optional)
        Type: integer
        
        minimum: 0
      
      Additional properties: false

Additional properties: false

## Examples

### JSON-RPC

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "discourse_update_workflow",
    "arguments": {
        "id": "string",
        "name": "string",
        "tags": [
          "string"
        ],
        "timezone": "string",
        "error_workflow_id": "string",
        "static_data": {},
        "published": true,
        "autosaved": true,
        "nodes": [
          {
            "id": "string",
            "type": "string",
            "name": "string",
            "parameters": {},
            "credentials": {}
          }
        ],
        "connections": [
          {
            "from": "string",
            "to": "string",
            "type": "main",
            "output_index": 0,
            "input_index": 0
          }
        ],
        "operations": [
          {
            "op": "add_node",
            "id": "string",
            "node": {
              "id": "string",
              "type": "string",
              "name": "string",
              "parameters": {},
              "credentials": {}
            }
          }
        ]
      }
  }
}
```

### TypeScript

```typescript
const result = await client.callTool({
  "name": "discourse_update_workflow",
  "arguments": {
    "id": "string",
    "name": "string",
    "tags": [
      "string"
    ],
    "timezone": "string",
    "error_workflow_id": "string",
    "static_data": {},
    "published": true,
    "autosaved": true,
    "nodes": [
      {
        "id": "string",
        "type": "string",
        "name": "string",
        "parameters": {},
        "credentials": {}
      }
    ],
    "connections": [
      {
        "from": "string",
        "to": "string",
        "type": "main",
        "output_index": 0,
        "input_index": 0
      }
    ],
    "operations": [
      {
        "op": "add_node",
        "id": "string",
        "node": {
          "id": "string",
          "type": "string",
          "name": "string",
          "parameters": {},
          "credentials": {}
        }
      }
    ]
  }
});
```

### Python

```python
result = await session.call_tool("discourse_update_workflow", arguments={
  "id": "string",
  "name": "string",
  "tags": [
    "string"
  ],
  "timezone": "string",
  "error_workflow_id": "string",
  "static_data": {},
  "published": true,
  "autosaved": true,
  "nodes": [
    {
      "id": "string",
      "type": "string",
      "name": "string",
      "parameters": {},
      "credentials": {}
    }
  ],
  "connections": [
    {
      "from": "string",
      "to": "string",
      "type": "main",
      "output_index": 0,
      "input_index": 0
    }
  ],
  "operations": [
    {
      "op": "add_node",
      "id": "string",
      "node": {
        "id": "string",
        "type": "string",
        "name": "string",
        "parameters": {},
        "credentials": {}
      }
    }
  ]
})
```


## Delete Workflow

`TOOL discourse_delete_workflow`

Permanently delete a workflow. Fails when another workflow calls it.

Authentication: no security requirement declared for this operation.

Request body: application/json (required)

Type: object

- `id` (required)
  Type: string | integer
  
  anyOf:
    Type: string
    
    pattern: "^\\d+$"
  
    Type: integer
    
    exclusiveMinimum: 0

Additional properties: false

## Examples

### JSON-RPC

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "discourse_delete_workflow",
    "arguments": {
        "id": "string"
      }
  }
}
```

### TypeScript

```typescript
const result = await client.callTool({
  "name": "discourse_delete_workflow",
  "arguments": {
    "id": "string"
  }
});
```

### Python

```python
result = await session.call_tool("discourse_delete_workflow", arguments={
  "id": "string"
})
```


## Discard Workflow Draft

`TOOL discourse_discard_workflow_draft`

Replace the draft with its published snapshot. Requires an existing published version.

Authentication: no security requirement declared for this operation.

Request body: application/json (required)

Type: object

- `id` (required)
  Type: string | integer
  
  anyOf:
    Type: string
    
    pattern: "^\\d+$"
  
    Type: integer
    
    exclusiveMinimum: 0

Additional properties: false

## Examples

### JSON-RPC

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "discourse_discard_workflow_draft",
    "arguments": {
        "id": "string"
      }
  }
}
```

### TypeScript

```typescript
const result = await client.callTool({
  "name": "discourse_discard_workflow_draft",
  "arguments": {
    "id": "string"
  }
});
```

### Python

```python
result = await session.call_tool("discourse_discard_workflow_draft", arguments={
  "id": "string"
})
```


## Restore Workflow Version

`TOOL discourse_restore_workflow_version`

Restore a historical workflow version by UUID into the draft.

Authentication: no security requirement declared for this operation.

Request body: application/json (required)

Type: object

- `workflow_id` (required)
  Type: string | integer
  
  anyOf:
    Type: string
    
    pattern: "^\\d+$"
  
    Type: integer
    
    exclusiveMinimum: 0

- `version_id` (required)
  Type: string, uuid

Additional properties: false

## Examples

### JSON-RPC

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "discourse_restore_workflow_version",
    "arguments": {
        "workflow_id": "string",
        "version_id": "550e8400-e29b-41d4-a716-446655440000"
      }
  }
}
```

### TypeScript

```typescript
const result = await client.callTool({
  "name": "discourse_restore_workflow_version",
  "arguments": {
    "workflow_id": "string",
    "version_id": "550e8400-e29b-41d4-a716-446655440000"
  }
});
```

### Python

```python
result = await session.call_tool("discourse_restore_workflow_version", arguments={
  "workflow_id": "string",
  "version_id": "550e8400-e29b-41d4-a716-446655440000"
})
```


## Run Workflow Draft

`TOOL discourse_run_workflow`

Run the current unpublished draft asynchronously. This can create posts, send chat, or call external HTTP; poll the returned execution id.

Authentication: no security requirement declared for this operation.

Request body: application/json (required)

Type: object

- `workflow_id` (required)
  Type: string | integer
  
  anyOf:
    Type: string
    
    pattern: "^\\d+$"
  
    Type: integer
    
    exclusiveMinimum: 0

- `trigger_node_id` (required)
  Type: string
  
  minLength: 1

- `trigger_data` (optional)
  Type: object
  
  Additional properties: 
    Type: any

Additional properties: false

## Examples

### JSON-RPC

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "discourse_run_workflow",
    "arguments": {
        "workflow_id": "string",
        "trigger_node_id": "string",
        "trigger_data": {}
      }
  }
}
```

### TypeScript

```typescript
const result = await client.callTool({
  "name": "discourse_run_workflow",
  "arguments": {
    "workflow_id": "string",
    "trigger_node_id": "string",
    "trigger_data": {}
  }
});
```

### Python

```python
result = await session.call_tool("discourse_run_workflow", arguments={
  "workflow_id": "string",
  "trigger_node_id": "string",
  "trigger_data": {}
})
```


## Run Workflow Step

`TOOL discourse_run_workflow_step`

Run one non-trigger, non-waiting draft node asynchronously. Requires upstream pin-data or a prior successful run.

Authentication: no security requirement declared for this operation.

Request body: application/json (required)

Type: object

- `workflow_id` (required)
  Type: string | integer
  
  anyOf:
    Type: string
    
    pattern: "^\\d+$"
  
    Type: integer
    
    exclusiveMinimum: 0

- `node_id` (required)
  Type: string
  
  minLength: 1

Additional properties: false

## Examples

### JSON-RPC

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "discourse_run_workflow_step",
    "arguments": {
        "workflow_id": "string",
        "node_id": "string"
      }
  }
}
```

### TypeScript

```typescript
const result = await client.callTool({
  "name": "discourse_run_workflow_step",
  "arguments": {
    "workflow_id": "string",
    "node_id": "string"
  }
});
```

### Python

```python
result = await session.call_tool("discourse_run_workflow_step", arguments={
  "workflow_id": "string",
  "node_id": "string"
})
```


## Update Workflow Pin Data

`TOOL discourse_update_workflow_pin_data`

Pin test items to a node name, or omit items to unpin it.

Authentication: no security requirement declared for this operation.

Request body: application/json (required)

Type: object

- `workflow_id` (required)
  Type: string | integer
  
  anyOf:
    Type: string
    
    pattern: "^\\d+$"
  
    Type: integer
    
    exclusiveMinimum: 0

- `node_name` (required)
  Type: string
  
  minLength: 1

- `items` (optional)
  Type: Array<object>
  
  Items:
    Type: object
    
    - `json` (required)
      Type: object
      
      Additional properties: 
        Type: any
    
    Additional properties: false

Additional properties: false

## Examples

### JSON-RPC

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "discourse_update_workflow_pin_data",
    "arguments": {
        "workflow_id": "string",
        "node_name": "string",
        "items": [
          {
            "json": {}
          }
        ]
      }
  }
}
```

### TypeScript

```typescript
const result = await client.callTool({
  "name": "discourse_update_workflow_pin_data",
  "arguments": {
    "workflow_id": "string",
    "node_name": "string",
    "items": [
      {
        "json": {}
      }
    ]
  }
});
```

### Python

```python
result = await session.call_tool("discourse_update_workflow_pin_data", arguments={
  "workflow_id": "string",
  "node_name": "string",
  "items": [
    {
      "json": {}
    }
  ]
})
```
