Appwrite.Services.Functions (appwrite v1.0.0)

View Source

The Functions service allows you to create custom behaviour that can be triggered by any supported Appwrite system events or by a predefined schedule.

Summary

Functions

create_execution(function_id, body \\ nil, xasync \\ nil, path \\ nil, method \\ nil, headers \\ nil, scheduled_at \\ nil)

@spec create_execution(
  String.t(),
  String.t() | nil,
  boolean() | nil,
  String.t() | nil,
  String.t() | nil,
  map() | nil,
  String.t() | nil
) :: {:ok, map()} | {:error, any()}

Create (trigger) a new function execution.

Parameters

  • function_id (required)
  • body (optional) – custom execution payload
  • xasync (optional) – when true, runs the execution asynchronously
  • path (optional) – custom path for the HTTP trigger
  • method (optional) – HTTP method for the trigger (GET, POST, etc.)
  • headers (optional) – map of custom request headers
  • scheduled_at (optional) – ISO 8601 date string for scheduled execution

get_execution(function_id, execution_id)

@spec get_execution(String.t(), String.t()) :: {:ok, map()} | {:error, any()}

Get an execution by its unique ID.

Parameters

  • function_id (required)
  • execution_id (required)

list_executions(function_id, queries \\ nil, search \\ nil, total \\ nil)

@spec list_executions(
  String.t(),
  [String.t()] | nil,
  String.t() | nil,
  boolean() | nil
) ::
  {:ok, map()} | {:error, any()}

List all executions for a given function.

Parameters

  • function_id (required)
  • queries (optional)
  • search (optional)
  • total (optional) – when false, skips count calculation