Passing variables from one flow to another

1,979 views
Skip to first unread message

avi.l...@gmail.com

unread,
Feb 20, 2016, 4:22:28 AM2/20/16
to Automate
Hi,
I'm new to "Automate" and have a basic problem of passing variables from one flow to another.
I'm trying to mimic something I do with tasker.
I have a flow which I would like to use in other flows. Specifically this is a flow that gets a location fix and stores it in a variable.
I would like to use that variable value in the parent flow but fail to understand how to.
I tried the following:
- In the "get location" flow - atomic store of the variable that holds the location fix
- In the parent flow - flow start(get location) --> when fiber stops --> yes --> atomic load

This did not seem to work.
When "toasting" the variable that I atomically loaded to, I get nothing.

Would appreciate your help.

Thank you.
Avi

c...@taranis.org

unread,
Feb 20, 2016, 9:50:54 AM2/20/16
to Automate, avi.l...@gmail.com

Henrik "The Developer" Lindqvist

unread,
Feb 20, 2016, 10:37:48 AM2/20/16
to Automate, avi.l...@gmail.com
The Atomic blocks only work within the same flow.

Automate works very differently compared to Tasker, trying to mimic it's behavior isn't advised.
Flows in Automate are meant to be shared, that's why most features are designed to keep them standalone, and not depend on other flows.

avi.l...@gmail.com

unread,
Feb 20, 2016, 11:22:03 AM2/20/16
to Automate, avi.l...@gmail.com, c...@taranis.org
Thank you.

avi.l...@gmail.com

unread,
Feb 20, 2016, 11:24:37 AM2/20/16
to Automate, avi.l...@gmail.com
Thanks Henrik.
How would you recommend working with commonly used flows?
If I have a sub-flow that I'd like to use in several other flows.
Is there a better way of using Automate other than sub-flows?

Avi 

Henrik "The Developer" Lindqvist

unread,
Feb 20, 2016, 12:19:49 PM2/20/16
to Automate, avi.l...@gmail.com
Do the sub-flows really need to be executed sequentially?
For a simple location check why do you need to keep that in a separate flow?

Avi Levi

unread,
Feb 20, 2016, 12:55:52 PM2/20/16
to Henrik The Developer Lindqvist, Automate

Because I use the same actions in multiple flows and don't want to repeat them.

Henrik "The Developer" Lindqvist

unread,
Feb 20, 2016, 1:21:49 PM2/20/16
to Automate, henrik.l...@gmail.com, avi.l...@gmail.com
You can start another flow with "input values" by specifying a payload, however a started flow can't return a value.

In your case, if you have a "master" location check flow, it can starts other "profile" flows with the location as a payload.



On Saturday, February 20, 2016 at 6:55:52 PM UTC+1, Avi Levi wrote:

Because I use the same actions in multiple flows and don't want to repeat them.

Christophe Kalt

unread,
Feb 20, 2016, 4:15:25 PM2/20/16
to Henrik The Developer Lindqvist, Automate, avi.l...@gmail.com
Avi,

On Sat, Feb 20, 2016 at 10:37 AM, Henrik "The Developer" Lindqvist <henrik.l...@gmail.com> wrote:
Automate works very differently compared to Tasker, trying to mimic it's behavior isn't advised.

I recently switched from Tasker, and remember looking to do just what you're trying to do here. My advice: take the time to get to know Automate and understand how it works.

Tasker gives you lots of things "for free", but it also constrains you because it assumes a lot about your needs and forces the "flows" to fit a specific mold. Automate doesn't impose anything, instead it gives you incredible freedom, and so it took a while for me to adjust and change my perspective. The flows I have now are quite different from the Profiles I used to have, but their behavior is a better match for my needs than the profiles were.

Avi Levi

unread,
Feb 21, 2016, 4:35:28 AM2/21/16
to Christophe Kalt, Henrik The Developer Lindqvist, Automate
Thanks Christophe.
I guess it will take some time to change a way of thinking, but I intend to do just that :)

mbi...@gmail.com

unread,
Mar 20, 2016, 9:06:09 PM3/20/16
to Automate, avi.l...@gmail.com, c...@taranis.org
On Saturday, 20 February 2016 22:15:25 UTC+1, Christophe Kalt wrote:
Tasker gives you lots of things "for free", but it also constrains you because it assumes a lot about your needs and forces the "flows" to fit a specific mold. Automate doesn't impose anything, instead it gives you incredible freedom, and so it took a while for me to adjust and change my perspective. The flows I have now are quite different from the Profiles I used to have, but their behavior is a better match for my needs than the profiles were.

So how would you go about for e.g. storing your "HOME" location somewhere to be able to use it in different flows without having to specify it for each one separately? Or some API key for a web service you're using in multiple flows?

I'm also trying to convert from Tasker to Automate, but I see some road blocks with that model, e.g. having 2 conditions which have both to apply as a trigger. Automagic seems to be the best of both worlds: More like Tasker but with a flow interface. However, a few tasks are much more elegant in Automate than the other two. So I'd be happy if you could provide some common problems and how they're solved in Automate.

Henrik "The Developer" Lindqvist

unread,
Mar 23, 2016, 9:08:07 PM3/23/16
to Automate, avi.l...@gmail.com, c...@taranis.org, mbi...@gmail.com
As for HOME location or API key either;
read it from a config file, maybe using the jsonDecode function,
or ask for it at first launch, using a Location pick and Dialog input then store it in Atomics.

Use the Fork or Subroutine blocks to have two conditions perform the same actions:
       :
     Fork -----------------+
       |                   |
+----->+<--------+  +----->+<--------+
|  Condition 1 --+  |  Condition 2 --+
|      |            |      |
|    Fork --+       |    Fork --+
+------+    |       +------+    |
            |                   |
            +-------------------+
            |
     [common actions]

bolan...@gmail.com

unread,
Mar 29, 2016, 8:08:19 PM3/29/16
to Automate
If absolutely necessary, the clipboard can be used to pass data between flows. I use this for one of mine currently.

Jeno Javory

unread,
Sep 8, 2021, 11:32:11 AM9/8/21
to Automate
Hi! Putting Automate Llama Lab Software - how to Put variables from a flow to another:
Use Clipboard memory.
 Best Wishes!

Jeno Javory

unread,
Sep 8, 2021, 11:32:44 AM9/8/21
to Automate
Hi ! Use Clipboard memory to transfer datas :)

Henrik "The Developer" Lindqvist

unread,
Sep 8, 2021, 11:40:50 AM9/8/21
to Automate
Use the Payload argument in the Flow start block, or a Broadcast send and receive blocks.

Bushmills

unread,
Sep 8, 2021, 12:20:47 PM9/8/21
to Automate
The few times when I need a variable available to many unrelated flows, I use a file. There are currently two of these "global" variables:   the home/away indicator, and a flag indicating whether (spoken) messages are enabled or disabled. Both of those are found in a directory assigned for that purpose:   Automate/global, with the file name representing the name of that "global variable".

TuLab

unread,
Oct 22, 2021, 1:08:42 PM10/22/21
to Automate
Is there any step by step tutorial for this please?

Henrik "The Developer" Lindqvist

unread,
Oct 22, 2021, 2:46:31 PM10/22/21
to Automate
  1. In the Flow start block set toe Payload input argument to: "Hello world"
  2. In the Flow beginning block assign the Payload output variable name: payload
  3. After the Flow beginning block add an Log append block and set the Message= payload

Shari Shark

unread,
Oct 22, 2021, 7:04:37 PM10/22/21
to automa...@googlegroups.com
Use this to see how variables can be passed between flows.


--
You received this message because you are subscribed to the Google Groups "Automate" group.
To unsubscribe from this group and stop receiving emails from it, send an email to automate-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/automate-user/0232f322-a521-45b9-bcd9-132d43d2e969n%40googlegroups.com.

TuLab

unread,
Oct 25, 2021, 3:30:06 AM10/25/21
to Automate
Brilliant. This is the kind of thing that I was after. Thank you!
Reply all
Reply to author
Forward
0 new messages