---
related_nodes: ["discord_action", "discord_component"]
---

# Discord Modal Submit

Starts a workflow from Discord modal submit interactions received through a `discord_bot` connection's gateway.

For multi-step state, store sessions in Feather tables. See [Bot Form State With Feather Tables](../workflows/bot-form-state-with-feather-tables.md).

## When to Use

- Process submitted modal fields
- Continue a component workflow after showing a modal
- Route modal workflows by modal `custom_id`
- Feed interaction IDs and tokens into `Discord Action`

## Configuration

### connection

The `discord_bot` connection whose gateway modal submit interactions start the workflow. Add one under **Settings → Connections**; agents discover existing ones with `list_connections` and `provider_name: "discord_bot"`, then pass the returned connection id. Gateway intents come from the connection's `intents` property.

### custom_id_exact

Optional exact modal `custom_id` filter. If set, only exact matches trigger the workflow.

### custom_id_prefix

Optional modal `custom_id` prefix filter. Used only when `custom_id_exact` is empty.

## Output Contract

The node emits one `output` object:

```json
{
  "event": "modal_submit",
  "interaction": {
    "id": "123",
    "application_id": "456",
    "token": "interaction_token",
    "channel_id": "789",
    "guild_id": "111",
    "user": { "id": "222", "username": "alice" }
  },
  "modal": {
    "custom_id": "create_bot",
    "fields": {
      "name": "My Bot",
      "username": "my_bot"
    },
    "components": []
  },
  "message": null
}
```

## Tips

- Exact `custom_id` matching takes precedence over prefix matching.
- Each matching submission starts one run, in the order Discord sent them, including submissions that arrive while earlier runs are still going.
- `modal.fields` is keyed by submitted component `custom_id`.
- `modal.components` preserves Discord's submitted component structure for advanced workflows.
- Use Feather tables for concurrent multi-step form state.
