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.Rate limit
Path
Function ID.
Body
String of custom data to send to function.
Execute code in the background. Default value is false.
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.
The script status code.
The script response output string. Logs the last 4,000 characters of the execution response output.
The script stdout output string. Logs the last 4,000 characters of the execution stdout output. This will return an empty string unless the response is returned using an API key or as part of a webhook payload.
The script stderr output string. Logs the last 4,000 characters of the execution stderr output. This will return an empty string unless the response is returned using an API key or as part of a webhook payload.
The script execution duration in seconds.
import { Client, Functions } from "appwrite";
const client = new Client();
const functions = new Functions(client);
client .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID;
const promise = functions.createExecution('[FUNCTION_ID]');
promise.then(function (response) { console.log(response); // Success}, function (error) { console.log(error); // Failure});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.Rate limit
Path
Function ID.
Body
String of custom data to send to function.
Execute code in the background. Default value is false.
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.
The script status code.
The script response output string. Logs the last 4,000 characters of the execution response output.
The script stdout output string. Logs the last 4,000 characters of the execution stdout output. This will return an empty string unless the response is returned using an API key or as part of a webhook payload.
The script stderr output string. Logs the last 4,000 characters of the execution stderr output. This will return an empty string unless the response is returned using an API key or as part of a webhook payload.
The script execution duration in seconds.
import { Client, Functions } from "appwrite";
const client = new Client();
const functions = new Functions(client);
client .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID;
const promise = functions.createExecution('[FUNCTION_ID]');
promise.then(function (response) { console.log(response); // Success}, function (error) { console.log(error); // Failure});