Processing engine
Manage Processing engine triggers, test plugins, and send requests to trigger On Request plugins.
InfluxDB 3 Core provides the InfluxDB 3 processing engine, an embedded Python VM that can dynamically load and trigger Python plugins in response to events in your database. Use Processing engine plugins and triggers to run code and perform tasks for different database events.
/api/v3/configure/plugin_environment/install_packagesInstall plugin packages
Installs the specified Python packages into the processing engine plugin environment.
This endpoint is synchronous and blocks until the packages are installed.
Parameters
Header parameters
Content-Type
stringapplication/jsonRequest body required
application/jsonpackages
required
string[]["influxdb3-python","scipy","pandas==1.5.0","requests"]curl --request POST \
"https://localhost:8181/api/v3/configure/plugin_environment/install_packages" \
--header "Authorization: Bearer INFLUX_TOKEN" \
--header "Content-Type: application/json" \
--data-raw '{
"packages": [
"influxdb3-python",
"scipy",
"pandas==1.5.0",
"requests"
]
}'Responses
data
objecterror
string/api/v3/configure/plugin_environment/install_requirementsInstall plugin requirements
Installs requirements from a requirements file (also known as a “pip requirements file”) into the processing engine plugin environment.
This endpoint is synchronous and blocks until the requirements are installed.
Related
Parameters
Header parameters
Content-Type
stringapplication/jsonRequest body required
application/jsonrequirements_location
required
string"requirements.txt"curl --request POST \
"https://localhost:8181/api/v3/configure/plugin_environment/install_requirements" \
--header "Authorization: Bearer INFLUX_TOKEN" \
--header "Content-Type: application/json" \
--data-raw '{
"requirements_location": "requirements.txt"
}'Responses
data
objecterror
string/api/v3/configure/processing_engine_triggerCreate processing engine trigger
Request body required
application/jsondb
required
stringdisabled
required
booleanplugin_filename
required
stringThe path and filename of the plugin to execute–for example,
schedule.py or endpoints/report.py.
The path can be absolute or relative to the --plugins-dir directory configured when starting InfluxDB 3.
The plugin file must implement the trigger interface associated with the trigger’s specification.
trigger_arguments
objecttrigger_name
required
stringtrigger_settings
required
stringtrigger_specification
required
stringSpecifies when and how the processing engine trigger should be invoked.
Supported trigger specifications:
Cron-based scheduling
Format: cron:CRON_EXPRESSION
Uses extended (6-field) cron format (second minute hour day_of_month month day_of_week):
┌───────────── second (0-59)
│ ┌───────────── minute (0-59)
│ │ ┌───────────── hour (0-23)
│ │ │ ┌───────────── day of month (1-31)
│ │ │ │ ┌───────────── month (1-12)
│ │ │ │ │ ┌───────────── day of week (0-6, Sunday=0)
│ │ │ │ │ │
* * * * * *Examples:
cron:0 0 6 * * 1-5- Every weekday at 6:00 AMcron:0 30 14 * * 5- Every Friday at 2:30 PMcron:0 0 0 1 * *- First day of every month at midnight
Interval-based scheduling
Format: every:DURATION
Supported durations: s (seconds), m (minutes), h (hours), d (days), w (weeks), M (months), y (years):
every:30s- Every 30 secondsevery:5m- Every 5 minutesevery:1h- Every hourevery:1d- Every dayevery:1w- Every weekevery:1M- Every monthevery:1y- Every year
Maximum interval: 1 year
Table-based triggers
all_tables- Triggers on write events to any table in the databasetable:TABLE_NAME- Triggers on write events to a specific table
On-demand triggers
Format: request:REQUEST_PATH
Creates an HTTP endpoint /api/v3/engine/REQUEST_PATH for manual invocation:
request:hello-world- Creates endpoint/api/v3/engine/hello-worldrequest:data-export- Creates endpoint/api/v3/engine/data-export
"cron:0 0 6 * * 1-5"curl --request POST \
"https://localhost:8181/api/v3/configure/processing_engine_trigger" \
--header "Authorization: Bearer INFLUX_TOKEN" \
--header "Content-Type: application/json" \
--data-raw '{
"db": "DB",
"disabled": false,
"plugin_filename": "PLUGIN_FILENAME",
"trigger_arguments": {},
"trigger_name": "TRIGGER_NAME",
"trigger_settings": "TRIGGER_SETTINGS",
"trigger_specification": "cron:0 0 6 * * 1-5"
}'Responses
data
objecterror
string/api/v3/configure/processing_engine_triggerDelete processing engine trigger
Parameters
Query parameters
db
required
stringtrigger_name
required
stringforce
booleancurl --request DELETE \
"https://localhost:8181/api/v3/configure/processing_engine_trigger?db=DB&trigger_name=TRIGGER_NAME" \
--header "Authorization: Bearer INFLUX_TOKEN"Responses
data
objecterror
string/api/v3/configure/processing_engine_trigger/disableDisable processing engine trigger
Parameters
Query parameters
db
required
stringtrigger_name
required
stringcurl --request POST \
"https://localhost:8181/api/v3/configure/processing_engine_trigger/disable?db=DB&trigger_name=TRIGGER_NAME" \
--header "Authorization: Bearer INFLUX_TOKEN"Responses
data
objecterror
string/api/v3/configure/processing_engine_trigger/enableEnable processing engine trigger
Parameters
Query parameters
db
required
stringtrigger_name
required
stringcurl --request POST \
"https://localhost:8181/api/v3/configure/processing_engine_trigger/enable?db=DB&trigger_name=TRIGGER_NAME" \
--header "Authorization: Bearer INFLUX_TOKEN"Responses
data
objecterror
string/api/v3/engine/{request_path}On Request processing engine plugin request
Executes the On Request processing engine plugin specified in the trigger’s plugin_filename.
The request can include request headers, query string parameters, and a request body, which InfluxDB passes to the plugin.
An On Request plugin implements the following signature:
def process_request(influxdb3_local, query_parameters, request_headers, request_body, args=None)The response depends on the plugin implementation.
curl --request GET \
"https://localhost:8181/api/v3/engine/{request_path}" \
--header "Authorization: Bearer INFLUX_TOKEN"Responses
data
objecterror
string/api/v3/engine/{request_path}On Request processing engine plugin request
Executes the On Request processing engine plugin specified in the trigger’s plugin_filename.
The request can include request headers, query string parameters, and a request body, which InfluxDB passes to the plugin.
An On Request plugin implements the following signature:
def process_request(influxdb3_local, query_parameters, request_headers, request_body, args=None)The response depends on the plugin implementation.
Parameters
Header parameters
Content-Type
stringapplication/jsonRequest body
application/jsoncurl --request POST \
"https://localhost:8181/api/v3/engine/{request_path}" \
--header "Authorization: Bearer INFLUX_TOKEN" \
--header "Content-Type: application/json"Responses
data
objecterror
string/api/v3/plugin_test/scheduleTest scheduling plugin
Request body required
application/jsoncache_name
stringdatabase
required
stringfilename
required
stringinput_arguments
objectschedule
stringcurl --request POST \
"https://localhost:8181/api/v3/plugin_test/schedule" \
--header "Authorization: Bearer INFLUX_TOKEN" \
--header "Content-Type: application/json" \
--data-raw '{
"cache_name": "CACHE_NAME",
"database": "DATABASE",
"filename": "FILENAME",
"input_arguments": {},
"schedule": "SCHEDULE"
}'Responses
data
objecterror
string/api/v3/plugin_test/walTest WAL plugin
Request body required
application/jsoncache_name
stringdatabase
required
stringfilename
required
stringinput_arguments
objectinput_lp
required
stringcurl --request POST \
"https://localhost:8181/api/v3/plugin_test/wal" \
--header "Authorization: Bearer INFLUX_TOKEN" \
--header "Content-Type: application/json" \
--data-raw '{
"cache_name": "CACHE_NAME",
"database": "DATABASE",
"filename": "FILENAME",
"input_arguments": {},
"input_lp": "INPUT_LP"
}'Responses
data
objecterror
string/api/v3/plugins/directoryUpdate a multi-file plugin directory
Replaces all files in a multi-file plugin directory. The
plugin_name must match a registered trigger name. Each entry in
the files array specifies a relative_path and content—the
server writes them into the trigger’s plugin directory.
Use this endpoint to update multi-file plugins (directories with
__init__.py and supporting modules). For single-file plugins,
use PUT /api/v3/plugins/files instead.
Request body required
application/jsonfiles
required
object[]plugin_name
required
stringcurl --request PUT \
"https://localhost:8181/api/v3/plugins/directory" \
--header "Authorization: Bearer INFLUX_TOKEN" \
--header "Content-Type: application/json" \
--data-raw '{
"files": [],
"plugin_name": "PLUGIN_NAME"
}'Responses
data
objecterror
stringplugin_name does not match any registered trigger./api/v3/plugins/filesCreate a plugin file
content to a file named after plugin_name. Does not require an
existing trigger—use this to upload plugin files before creating
triggers that reference them.Request body required
application/jsoncontent
required
stringplugin_name
required
stringcurl --request POST \
"https://localhost:8181/api/v3/plugins/files" \
--header "Authorization: Bearer INFLUX_TOKEN" \
--header "Content-Type: application/json" \
--data-raw '{
"content": "CONTENT",
"plugin_name": "PLUGIN_NAME"
}'Responses
data
objecterror
string/api/v3/plugins/filesUpdate a plugin file
Updates a single plugin file for an existing trigger. The
plugin_name must match a registered trigger name—the server
resolves the trigger’s plugin_filename and overwrites that file
with the provided content.
To upload a new plugin file before creating a trigger, use
POST /api/v3/plugins/files instead. To update a multi-file
plugin directory, use PUT /api/v3/plugins/directory.
Request body required
application/jsoncontent
required
stringplugin_name
required
stringcurl --request PUT \
"https://localhost:8181/api/v3/plugins/files" \
--header "Authorization: Bearer INFLUX_TOKEN" \
--header "Content-Type: application/json" \
--data-raw '{
"content": "CONTENT",
"plugin_name": "PLUGIN_NAME"
}'Responses
data
objecterror
stringplugin_name does not match any registered trigger.Was this page helpful?
Thank you for your feedback!
Support and feedback
Thank you for being part of our community! We welcome and encourage your feedback and bug reports for InfluxDB 3 Core and this documentation. To find support, use the following resources:
Customers with an annual or support contract can contact InfluxData Support.