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.
Execution
Execution ID.
Execution creation date in ISO 8601 format.
Execution upate date in ISO 8601 format.
Execution roles.
Function ID.
The trigger that caused the function to execute. Possible values can be: http, schedule, or event.
The status of the function execution. Possible values can be: waiting, processing, completed, or failed.
HTTP request method type.
HTTP request path and query.
HTTP response headers as a key-value object. This will return only whitelisted headers. All headers are returned if execution is created as synchronous.
Object type
HTTP response status code.
HTTP response body. This will return empty unless execution is created as synchronous.
HTTP response headers as a key-value object. This will return only whitelisted headers. All headers are returned if execution is created as synchronous.
Object type
Function logs. Includes the last 4,000 characters. This will return an empty string unless the response is returned using an API key or as part of a webhook payload.
Function errors. Includes the last 4,000 characters. This will return an empty string unless the response is returned using an API key or as part of a webhook payload.
Function execution duration in seconds.
import { Client, Functions, ExecutionMethod } from "appwrite";
const client = new Client() .setEndpoint('https://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
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.
Execution
Execution ID.
Execution creation date in ISO 8601 format.
Execution upate date in ISO 8601 format.
Execution roles.
Function ID.
The trigger that caused the function to execute. Possible values can be: http, schedule, or event.
The status of the function execution. Possible values can be: waiting, processing, completed, or failed.
HTTP request method type.
HTTP request path and query.
HTTP response headers as a key-value object. This will return only whitelisted headers. All headers are returned if execution is created as synchronous.
Object type
HTTP response status code.
HTTP response body. This will return empty unless execution is created as synchronous.
HTTP response headers as a key-value object. This will return only whitelisted headers. All headers are returned if execution is created as synchronous.
Object type
Function logs. Includes the last 4,000 characters. This will return an empty string unless the response is returned using an API key or as part of a webhook payload.
Function errors. Includes the last 4,000 characters. This will return an empty string unless the response is returned using an API key or as part of a webhook payload.
Function execution duration in seconds.
import { Client, Functions, ExecutionMethod } from "appwrite";
const client = new Client() .setEndpoint('https://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);