# Executing several commands in sequence

**URL:** <https://discourse.nodered.org/t/executing-several-commands-in-sequence/45814>\
**Category:** General\
**Created:** [18 May 2021 07:18 UTC](https://discourse.nodered.org/t/executing-several-commands-in-sequence/45814 "2021-05-18T07:18:28Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![G-Rizzle](https://avatars.discourse-cdn.com/v4/letter/g/7c8e57/32.png) [@G-Rizzle](https://discourse.nodered.org/u/G-Rizzle)\
**Post date:** [18 May 2021 07:18 UTC](https://discourse.nodered.org/t/executing-several-commands-in-sequence/45814/1 "2021-05-18T07:18:28Z")

</div>

hello,

Im trying to controll a tello drone with node red. i can use commands like "move forward 50 cm" or "move xyz" etc.

still i want to execute several commands in sequence with one "click". i want to have a dashboard button that i can click and then the drone flies e.g. 50 cm forward and then 50 cm to the left. how do i realise this?

thanks in advance

---

<div class="post-metadata">

**Author:** ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)\
**Post date:** [18 May 2021 07:24 UTC](https://discourse.nodered.org/t/executing-several-commands-in-sequence/45814/2 "2021-05-18T07:24:51Z")

</div>

Hi. you could put all commands in an array then split array and rate limit.  
e.g.

```auto
[{"id":"c3d17baa.336608","type":"inject","z":"c74669a0.6a34f8","name":"multi command","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"[\"move forward 50cm\", \"move right 50 cm\", \"move back 100cm\"]","payloadType":"json","x":180,"y":660,"wires":[["1a8ededc.007151"]]},{"id":"1a8ededc.007151","type":"split","z":"c74669a0.6a34f8","name":"","splt":"\\n","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"","x":350,"y":660,"wires":[["6770779e.c38b3"]]},{"id":"6770779e.c38b3","type":"delay","z":"c74669a0.6a34f8","name":"","pauseType":"rate","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":530,"y":660,"wires":[["f3880de1.60f03"]]},{"id":"30c8fbef.3d9d2c","type":"inject","z":"c74669a0.6a34f8","name":"single command","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"[\"move forward 50cm\"]","payloadType":"json","x":200,"y":700,"wires":[["1a8ededc.007151"]]},{"id":"f3880de1.60f03","type":"debug","z":"c74669a0.6a34f8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":730,"y":660,"wires":[]}]

```

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [17 July 2021 07:25 UTC](https://discourse.nodered.org/t/executing-several-commands-in-sequence/45814/3 "2021-07-17T07:25:24Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
