Rank 2: Process
I assigned the API_KEY variable in a file and uploaded it to the function. I did this just once. Every time I make a change to index.php, I create a deployment on the command line of my Mac, and it shows up as a new active deployment. I then execute the function by clicking the Execute Now button. If the prior execution failed, this one will succeed. Then the next one will fail, ad infinitum. So it appears that appwrite has a memory across function executions, and it passes the API_KEY variable on every other execution only.