I decided to see if I could answer this myself, and set up some tests. As it turns out the answer is #2, with an additional caveat.
Here’s what the actual limit is—The outputandinput APIs both have a hard cap of 6MB per Script Action. Within a single Script Action, you can input up to 6MB of data using the input API, and output up to 6MB of data using the output API (6MB in plus 6MB out).
If you have an automation with many Script actions, there is no limit on the total cumulative amount of output data shared between all of the actions. The limit only applies within a single action. If you have multiple actions outputting data, you can input data from several actions into future action, but you still have to respect the 6MB limit.
For example, let’s say you have 4 Actions. Actions A, B, and C each output 3MB apiece. Action D uses the output data from those previous actions. If Action D inputs 3MB from Action A and 3MB from Action B, it is within the 6MB limit so everything is fine. If however, you try to input the 3MB data from all 3 actions into Action D, the script will fail with an “unknown error” because you have exceeded the 6MB limit.
Hope this helps someone in the future!
I fudged the numbers a little bit…even though Airtable specifies 6MB (ie. megabytes, or 6,000,000 characters) as the output limit, based on my testing it actually seems to be closer to 6MiB (ie. mebibytes, or 6,291,456 characters) for the entire output payload (including the length of the output variable names, and possibly other metadata). So to be safe, it’s easier to just treat the limit as 6MB and leave the extra ~290KB as headroom.