Create execution
Endpoint
posthttps://<REGION>.cloud.appwrite.io/v1/functions/{functionId}/executions
Description
Trigger a function execution. The returned object will return you the current execution status. You can ping the Get Execution endpoint to get updates on the current execution status. Once this endpoint is called, your function execution process will start asynchronously.
Required scopes
Authentication
setProject() and ensure the user is signed in. The SDK sends the session header automatically after login.Path
Function ID.
Body
HTTP body of execution. Default value is empty string.
Execute code in the background. Default value is false.
HTTP path of execution. Path can include query params. Default value is /
HTTP method of execution. Default value is GET.
HTTP headers of execution. Defaults to empty.
Scheduled execution time in ISO 8601 format. DateTime value must be in future with precision in minutes.
import { Client, Functions, ExecutionMethod } from "appwrite";
const client = new Client() .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>'); // Your project ID
const functions = new Functions(client);
const result = await functions.createExecution( '<FUNCTION_ID>', // functionId '<BODY>', // body (optional) false, // async (optional) '<PATH>', // path (optional) ExecutionMethod.GET, // method (optional) {}, // headers (optional) '' // scheduledAt (optional));
console.log(result);Functions
executions
Create execution
Endpoint
posthttps://<REGION>.cloud.appwrite.io/v1/functions/{functionId}/executions
Description
Trigger a function execution. The returned object will return you the current execution status. You can ping the Get Execution endpoint to get updates on the current execution status. Once this endpoint is called, your function execution process will start asynchronously.
Required scopes
Authentication
setProject() and ensure the user is signed in. The SDK sends the session header automatically after login.Path
Function ID.
Body
HTTP body of execution. Default value is empty string.
Execute code in the background. Default value is false.
HTTP path of execution. Path can include query params. Default value is /
HTTP method of execution. Default value is GET.
HTTP headers of execution. Defaults to empty.
Scheduled execution time in ISO 8601 format. DateTime value must be in future with precision in minutes.
import { Client, Functions, ExecutionMethod } from "appwrite";
const client = new Client() .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>'); // Your project ID
const functions = new Functions(client);
const result = await functions.createExecution( '<FUNCTION_ID>', // functionId '<BODY>', // body (optional) false, // async (optional) '<PATH>', // path (optional) ExecutionMethod.GET, // method (optional) {}, // headers (optional) '' // scheduledAt (optional));
console.log(result);