Skip to content

Add missing execution info to Functions doc #2147

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

ebenezerdon
Copy link
Contributor

What does this PR do?

Updates Functions documentation to include some missing info about executions

Test Plan

  • /docs/products/functions/executions
  • /docs/products/functions/execute
  • /docs/tooling/command-line/functions#commands

Related PRs and Issues

DRL-1514

@ebenezerdon ebenezerdon self-assigned this Jun 25, 2025
Copy link

appwrite bot commented Jun 25, 2025

appwrite.io

Project ID: 684969cb000a2f6c0a02

Sites (1)
Site Status Logs Preview QR
 website
68496a17000f03d62013
Failed Failed View Logs Preview URL QR Code

Note

You can use Avatars API to generate QR code for any text or URLs.

@coolify-appwrite-org
Copy link

coolify-appwrite-org bot commented Jul 2, 2025

The preview deployment failed. 🔴

Open Build Logs

Last updated at: 2025-07-02 13:18:55 CET

@TorstenDittmann TorstenDittmann force-pushed the main branch 5 times, most recently from 6e3c6b4 to 83e3ebc Compare July 7, 2025 15:18
* `create-execution [options]`
* 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.
* `create-execution [options]`
* 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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like this needs to be updated too. They should match up. Maybe we should just change it to:

Suggested change
* 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.
* Trigger a function execution.

Comment on lines -331 to +371
functionId: "<FUNCTION_ID>"
body: "<BODY>" // optional
async: false // optional
path: "<PATH>" // optional
method: "GET" // optional
functionId: "<FUNCTION_ID>"
body: "<BODY>" // optional
async: false // optional
path: "<PATH>" // optional
method: "GET" // optional
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice job with the white space cleanup

@@ -11,6 +11,42 @@ Appwrite Functions can be executed in several ways.
Executions can be invoked through the Appwrite SDK and visiting its REST endpoint. Functions can also be triggered by events and scheduled executions.
Here are all the different ways to consume your Appwrite Functions.

# Execution modes {% #execution-modes %}

Appwrite Functions support two execution modes: **synchronous** and **asynchronous**. Understanding the difference between these modes is important for building efficient applications.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's try to keep docs concise and to the point:

Suggested change
Appwrite Functions support two execution modes: **synchronous** and **asynchronous**. Understanding the difference between these modes is important for building efficient applications.
Appwrite Functions support two execution modes: **synchronous** and **asynchronous**.


Synchronous executions:
- Return response bodies and headers directly to the client
- Have a **30-second timeout limit** to prevent long-running requests from blocking Appwrite workers
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's reword this to something like:

Suggested change
- Have a **30-second timeout limit** to prevent long-running requests from blocking Appwrite workers
- Have a **30-second timeout limit** to discourage slow API calls from apps causing poor user experience

- Return response bodies and headers directly to the client
- Have a **30-second timeout limit** to prevent long-running requests from blocking Appwrite workers
- Are ideal for real-time operations where you need immediate response data
- Work best for lightweight operations that complete quickly
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally, all function executions should be lightweight and complete quickly. That's the suggestion for all serverless functions.

Asynchronous executions:
- Have no timeout limitations beyond your function's configured timeout
- Do **not store** response bodies and headers and cannot be retrieved later
- Are ideal for long-running tasks, background processing, and event-driven workflows
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

long-running tasks,

I wouldn't say long-running. Definitely if it needs to be more than 30 seconds. I don't want to encourage long running executions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants