1 Resources function
Forgejo Actions edited this page 2026-11-26 06:34:52 +00:00

openwebui_function (Resource)

Manages an Open WebUI function, which is a Pipe, Filter, or Action plugin written in Python.

Open WebUI derives type and manifest_json from the Python source you provide, so both are read-only. The class you define, Pipe, Filter, or Action, sets the type.

A function reads its settings from openwebui_function_valves, a separate resource, so changing a setting does not rewrite the source.

Example Usage

resource "openwebui_function" "example" {
  function_id = "content_filter"
  name        = "Content Filter"
  description = "Filters inappropriate content from model responses"
  is_active   = true
  is_global   = false

  content = file("${path.module}/functions/content_filter.py")
}

Schema

Required

  • content (String) Python source code. The top-level class (Pipe, Filter, or Action) determines the function type.
  • function_id (String) Unique identifier for the function, e.g. content_filter. Must be lowercase letters, digits, or underscores. Forces replacement.
  • name (String) Display name of the function.

Optional

  • description (String) Short description shown in the Open WebUI interface.
  • is_active (Boolean) Whether the function is enabled. Defaults to false.
  • is_global (Boolean) Whether the function is applied globally to every chat. Defaults to false.

Read-Only

  • created_at (Number) Unix timestamp of creation. Set by Open WebUI.
  • id (String) Terraform identifier. Always equal to function_id.
  • manifest_json (String) JSON manifest derived from the Python frontmatter. Read-only; set by Open WebUI.
  • type (String) Function type derived from the Python source: pipe, filter, or action. Read-only; set by Open WebUI.
  • updated_at (Number) Unix timestamp of last update. Set by Open WebUI.
  • user_id (String) Owner user identifier. Set by Open WebUI.

Import

Import is supported using the following syntax:

The terraform import command can be used, for example:

# A function is imported by its function_id, the identifier it was registered
# under.
terraform import openwebui_function.example content_filter