In this module we’ll take some time to explore Child FLOs. Child FLOs are at the core of what makes FLOGramming extremely flexible, so let’s explore these powerful additions to Designer!


Course Material


In this module we’ll take some time to explore Child FLOs. Child FLOs are at the core of what makes FLOGramming extremely flexible, so let’s explore these powerful additions to Designer!

Overview

In any stable, efficient, and modular code, programmers heavily rely on:

  • Looping- the ability to repeat behavior over a set of items, and the ability to write functions that are able to be reused many times
  • Child FLOs provide FLOGrammers with the tools required to address both of these needs

Both of these concepts lead to programs that are easy to edit and debug, and are crucial in FLOs as well. Child FLOs allow you to do both.

What is a Child FLO?

A Child FLO is simply a FLO that is called by another FLO (aka “Parent FLO”).

Child FLOs work the same as any other FLO, with the exception that they are initiated by the “Child FLO” event card.

Important things to note about Child FLOs:

  • Child FLOs do not count towards your Active FLO limit
    • Why? They are directly dependent on other FLOs - so essentially they’re considered part of the same FLO
  • A Child FLO must be turned on before it can be called by other FLOs

When to Use Child FLOs

Going back to our discussion about programming needs, Child FLOs serve the Looping and Function requirements of programmers in the following ways:

  • Looping
    • You want to process a list, one item at a time
  • Functions or Subroutines
    • You have a series of steps that get used more than once in a single FLO (or across multiple FLOs)
    • You want to break up a very large FLO into smaller, more manageable parts
      • This is good programming design!

The Child FLO Card in Detail

Now that we have seen an example, let’s learn more about the Child FLO Action Card …

Inputs

Again, Child FLOs are primarily used for Looping and as “helper methods” or functions which can be used in many different FLOs. Both cases require you to provide inputs.

For example, perhaps I’m adding a Bug Request in a platform like JIRA that might come from Zendesk. In this case, I’d call my Child FLO and pass things like an issue type, name, description, etc.

Just as with other cards, you can add fields, set field types, etc.

Context

The Child FLO card also contains a number of “context” fields which are as follows:

  • Index
    • This number output is assigned a value when the FLO is called from a function that loops through the items of a list (e.g. a For Each or Map function).
    • The value of Index corresponds to the item in the list (starting with zero) processed by this particular instance of the FLO.
  • Caller
    • This object output is assigned a value when the FLO is called from another FLO.
    • The keys of the object allow you tell which FLO called the child FLO (id and name), which particular execution of the FLO made the call (_executionid), and which particular step in the FLO (method, which is an unique ID).
    • When the child FLO is manually run, then id and _executionid are null. This is especially useful for debugging purposes.
  • Error
    • This object output is assigned a value when the FLO is called for Error Handling – i.e. when a card in another FLO results in an error that halts the FLO.
    • The value of Error corresponds to the raw error object returns by the application or action that caused the error – e.g. an object that will often have keys that include “message”, “statusCode” and “execution” (the unique identifier of the FLO execution that caused the error, which can be used to construct a URL to the execution history that shows the FLO details that led to the error).
  • Execution ID
    • Returns the unique ID of the FLO instance.

Troubleshooting

Just as with other Troubleshooting we’ve done - you have tools at your disposal to help you figure out what’s causing problems with your Child FLOs!

Some Tips:

  • The iteration of which the child FLO is on will increment by one for Map and Reduce (starts on 0)
  • The Caller section has great information:
    • The ID, Name, and Execution ID pieces are helpful
    • If calling from multiple places - you can work backwards to debug

Common Examples

  • You iterated over a list for formatting (Probably list.map) and one of your items wasn’t formatted correctly. How do I go from the parent FLO, find the child FLO, and find the execution that caused the issue.
  • Common problem is the child FLO not receiving inputs correctly because the input wasn’t defined correctly. How can I tell when that happened, and how do I fix it?

Summary

Now that you know more about how to configure and use a Child FLO, you should be ready to build more powerful sets of FLOs to address your business needs.

Remember that Child FLOs allow you to loop, build reusable functions, or even just simply break up very long FLOs into more manageable parts!

Thanks for joining us and get out there and make some Connections