# Timeout error occurs after adding the function node in the edge workflow, why?

**URL:** <https://forums.losant.com/t/timeout-error-occurs-after-adding-the-function-node-in-the-edge-workflow-why/5170>\
**Category:** Help\
**Tags:** workflow\
**Created:** [July 31, 2023, 9:47am UTC](https://forums.losant.com/t/timeout-error-occurs-after-adding-the-function-node-in-the-edge-workflow-why/5170 "2023-07-31T09:47:38Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Abdurahman\_Hojkuric](https://avatars.discourse-cdn.com/v4/letter/a/b3f665/32.png) [@Abdurahman\_Hojkuric](https://forums.losant.com/u/Abdurahman_Hojkuric)\
**Post date:** [July 31, 2023, 9:47am UTC](https://forums.losant.com/t/timeout-error-occurs-after-adding-the-function-node-in-the-edge-workflow-why/5170/1 "2023-07-31T09:47:38Z")

</div>

Hi there  
Hope you are well.

I have one problem regarding the function node in the edge workflow.  
So, currently my edge workflow is working properly before adding the function node.  
I am using the string node to process the string, but as you know, it asks a lot of string nodes to process the complicated string. So I added the function node there, but it throws the timeout error and the whole edge workflow does not work.

So, what is wrong? Can you please help me?  
Thanks.

 ![image](https://us1.discourse-cdn.com/flex015/uploads/getstructure/original/2X/2/2414c51b30d08262a7953858079b528622667503.png)

---

<div class="post-metadata">

**Author:** ![Dylan\_Schuster](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.losant.com/dylan_schuster/32/2850_2.png) [@Dylan\_Schuster](https://forums.losant.com/u/Dylan_Schuster)\
**Post date:** [July 31, 2023, 12:00pm UTC](https://forums.losant.com/t/timeout-error-occurs-after-adding-the-function-node-in-the-edge-workflow-why/5170/2 "2023-07-31T12:00:06Z")

</div>

We had another user run into a similar problem last week, and it had to do with his hardware taking too long to spin up the Function Node’s sandbox environment.

There is a workaround: Set the [`MAX_FLOW_RUN_TIME` environment variable](https://docs.losant.com/edge-compute/gateway-edge-agent/usage/#advanced-options) to a much higher value, like `300000` (5 minutes). This works because the script to start up the Function Node’s sandbox environment will halt after (`MAX_FLOW_RUN_TIME` / 4) milliseconds.

We’re investigating this issue more but hopefully that gets you unblocked for now.

---

<div class="post-metadata">

**Author:** ![Abdurahman\_Hojkuric](https://avatars.discourse-cdn.com/v4/letter/a/b3f665/32.png) [@Abdurahman\_Hojkuric](https://forums.losant.com/u/Abdurahman_Hojkuric)\
**Post date:** [July 31, 2023, 1:07pm UTC](https://forums.losant.com/t/timeout-error-occurs-after-adding-the-function-node-in-the-edge-workflow-why/5170/3 "2023-07-31T13:07:13Z")

</div>

Hi @Dylan_Schuster  
Thank you for your update.

So, where can I set this environment variable? Can you please let me know in details?  
Thanks.

---

<div class="post-metadata">

**Author:** ![Dylan\_Schuster](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.losant.com/dylan_schuster/32/2850_2.png) [@Dylan\_Schuster](https://forums.losant.com/u/Dylan_Schuster)\
**Post date:** [July 31, 2023, 1:10pm UTC](https://forums.losant.com/t/timeout-error-occurs-after-adding-the-function-node-in-the-edge-workflow-why/5170/4 "2023-07-31T13:10:17Z")

</div>

This would go in the [script to start the GEA’s Docker container](https://docs.losant.com/edge-compute/gateway-edge-agent/usage/#running-with-environment-config). Something like …

```auto
docker run -d --restart always --name docs-agent \
  -e 'DEVICE_ID=<your-device-id>' \
  -e 'ACCESS_KEY=<your-access-key>' \
  -e 'ACCESS_SECRET=<your-access-secret>' \
  -e 'MAX_FLOW_RUN_TIME=300000' \
  -v /var/lib/losant-edge-agent/data:/data \
  losant/edge-agent

```

---

<div class="post-metadata">

**Author:** ![Abdurahman\_Hojkuric](https://avatars.discourse-cdn.com/v4/letter/a/b3f665/32.png) [@Abdurahman\_Hojkuric](https://forums.losant.com/u/Abdurahman_Hojkuric)\
**Post date:** [July 31, 2023, 1:39pm UTC](https://forums.losant.com/t/timeout-error-occurs-after-adding-the-function-node-in-the-edge-workflow-why/5170/5 "2023-07-31T13:39:08Z")

</div>

@Dylan_Schuster  
Thank you for your kind update.  
It worked for me.

Thanks!

---

<div class="post-metadata">

**Author:** ![Abdurahman\_Hojkuric](https://avatars.discourse-cdn.com/v4/letter/a/b3f665/32.png) [@Abdurahman\_Hojkuric](https://forums.losant.com/u/Abdurahman_Hojkuric)\
**Post date:** [July 31, 2023, 4:49pm UTC](https://forums.losant.com/t/timeout-error-occurs-after-adding-the-function-node-in-the-edge-workflow-why/5170/6 "2023-07-31T16:49:26Z")

</div>

Hi @Dylan_Schuster  
I have one more question, so now it is working properly. But I have found another issue.  
So, I am using the run executable node in my edge workflow, by the way, sometimes it does not get the result. And sometimes it gets the command result properly.  
I can not understand why.

Can you please help me in terms of this issue?  
Regards,

---

<div class="post-metadata">

**Author:** ![Dylan\_Schuster](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.losant.com/dylan_schuster/32/2850_2.png) [@Dylan\_Schuster](https://forums.losant.com/u/Dylan_Schuster)\
**Post date:** [July 31, 2023, 5:14pm UTC](https://forums.losant.com/t/timeout-error-occurs-after-adding-the-function-node-in-the-edge-workflow-why/5170/7 "2023-07-31T17:14:59Z")

</div>

Sorry, but I need a lot more info before I could be of help with that request. Are there any [errors](https://docs.losant.com/workflows/workflow-metrics/#workflow-errors) being thrown in the workflow execution? What sort of configuration are you providing to the Run Executable Node - including what exactly you are executing? And whatever the script is, is it possible it could not exit with a status code or it could hang?

I recommend starting a new thread for this request and providing as much information as you can.
