[{"data":1,"prerenderedAt":442,"buildId":443},["ShallowReactive",2],{"\u002Fautomations\u002Ffirst-workflow":3,"\u002Fautomations\u002Ffirst-workflow-surround":362,"navigation":375},{"id":4,"title":5,"body":6,"description":353,"extension":354,"meta":355,"navigation":356,"path":358,"seo":359,"stem":360,"__hash__":361},"docs\u002F2.automations\u002F02.first-workflow.md","Your first workflow",{"type":7,"value":8,"toc":338},"minimark",[9,28,31,43,286,291,302,306,321],[10,11,12,13,17,18,22,23,27],"p",{},"This walkthrough builds a small ",[14,15,16],"strong",{},"library workflow"," that you start by hand. For each file you run it on, it checks the width: images wider than 1920 pixels get a ",[19,20,21],"code",{},"large"," tag, and everything else moves to a folder called ",[24,25,26],"em",{},"Other",".",[10,29,30],{},"It takes a few minutes and touches every part of the editor you'll use later: the step picker, settings, values from earlier steps, branches, testing and publishing.",[32,33,34],"tip",{},[10,35,36,37,42],{},"Want to process uploads as they arrive instead? Start with ",[38,39,41],"a",{"href":40},"\u002Fautomations\u002Fguides\u002Fcompress-uploads","Compress and resize uploads",", which builds an intake workflow.",[44,45,47,52,78,81,85,103,106,110,121,156,159,163,187,198,202,230,236,240,247,254,258,268,272],"steps",{"level":46},"3",[48,49,51],"h3",{"id":50},"create-the-workflow","Create the workflow",[10,53,54,55,58,59,62,63,66,67,70,71,74,75,27],{},"Open ",[14,56,57],{},"Automations"," and click ",[14,60,61],{},"New workflow",". Give it a name such as ",[24,64,65],{},"Sort by size",", keep the kind as ",[14,68,69],{},"Library workflow",", and choose ",[14,72,73],{},"Run manually"," as the trigger. Click ",[14,76,77],{},"Create",[10,79,80],{},"The editor opens with a single step, the trigger.",[48,82,84],{"id":83},"add-a-condition","Add a Condition",[10,86,87,88,91,92,95,96,99,100,27],{},"Select the trigger and click the ",[14,89,90],{},"+"," beside it (or ",[14,93,94],{},"Add step"," in the toolbar). In the step picker, open ",[14,97,98],{},"Logic"," and choose ",[14,101,102],{},"Condition",[10,104,105],{},"The new step appears to the right of the trigger and its settings open in the panel on the right.",[48,107,109],{"id":108},"set-the-rule","Set the rule",[10,111,112,113,116,117,120],{},"A Condition continues on ",[14,114,115],{},"True"," when its rules match, and on ",[14,118,119],{},"False"," otherwise. Set up one rule:",[122,123,124,139,148],"ul",{},[125,126,127,130,131,134,135,138],"li",{},[14,128,129],{},"Value",": switch the field to ",[14,132,133],{},"From a step",", then pick ",[14,136,137],{},"Current file › Width",". This is the width of the file the run is about.",[125,140,141,144,145,27],{},[14,142,143],{},"Operator",": ",[24,146,147],{},"is greater than",[125,149,150,144,153,27],{},[14,151,152],{},"Compare with",[19,154,155],{},"1920",[10,157,158],{},"The step on the canvas now summarizes the rule.",[48,160,162],{"id":161},"tag-the-large-images","Tag the large images",[10,164,165,166,168,169,171,172,175,176,179,180,183,184,186],{},"Select the Condition and click the ",[14,167,90],{}," next to its ",[14,170,115],{}," output. Choose ",[14,173,174],{},"Add tags"," from the ",[14,177,178],{},"Organize"," group, and under ",[14,181,182],{},"Tag names"," enter ",[19,185,21],{},". A tag with a name that doesn't exist yet is created the first time the step runs.",[10,188,189,190,193,194,197],{},"The step's ",[14,191,192],{},"File"," setting (under ",[14,195,196],{},"Advanced",") is already the run's file, which is what you want.",[48,199,201],{"id":200},"move-everything-else","Move everything else",[10,203,204,205,207,208,210,211,214,215,218,219,222,223,225,226,229],{},"Click the ",[14,206,90],{}," next to the Condition's ",[14,209,119],{}," output and choose ",[14,212,213],{},"Move to folder",". Pick a folder, or leave ",[14,216,217],{},"Folder"," empty for ",[24,220,221],{},"All files"," and type ",[19,224,26],{}," in ",[14,227,228],{},"Subfolders"," to create the folder inside it.",[10,231,232,233,235],{},"Files that aren't images have no width, so the rule doesn't match and they take the ",[14,234,119],{}," branch too.",[48,237,239],{"id":238},"test-it","Test it",[10,241,242,243,246],{},"Click ",[14,244,245],{},"Test"," at the top of the editor and choose a file. The test runs your draft on that file and shows each step's result on the canvas: which branch the Condition took, and what the tag or move step would have done.",[10,248,249,250,27],{},"Nothing in your library changes during a test. See ",[38,251,253],{"href":252},"\u002Fautomations\u002Ftesting","Testing",[48,255,257],{"id":256},"publish-and-turn-it-on","Publish and turn it on",[10,259,242,260,263,264,267],{},[14,261,262],{},"Publish",", then turn on the ",[14,265,266],{},"Active"," switch. Manual workflows only show up in Files once they're published and active.",[48,269,271],{"id":270},"run-it-from-files","Run it from Files",[10,273,274,275,278,279,99,282,285],{},"In ",[14,276,277],{},"Files",", select one or more files, open ",[14,280,281],{},"More actions",[14,283,284],{},"Run automation › Sort by size",". A toast confirms how many runs started, with a link to the runs.",[287,288,290],"h2",{"id":289},"what-happened","What happened",[10,292,293,294,297,298,301],{},"Open the workflow's ",[14,295,296],{},"Runs"," tab to see one run per file. Each run shows which steps ran, which were skipped, and the values every step produced. On a wide image, the Move to folder step shows as ",[24,299,300],{},"Skipped"," because the run went down the True branch.",[287,303,305],{"id":304},"make-it-run-automatically","Make it run automatically",[10,307,308,309,312,313,316,317,320],{},"To run the same steps on every new upload instead of by hand, change the trigger: select it and click the ",[14,310,311],{},"Change trigger"," button in its settings (or right-click it on the canvas), then pick ",[14,314,315],{},"File uploaded",". You can limit it to some file types (for example ",[19,318,319],{},"image\u002F*",") or one folder. Publish again to apply the change.",[322,323,324],"note",{},[10,325,326,328,329,332,333,337],{},[24,327,315],{}," runs right after a file is saved, which can be before its thumbnail and dimensions are worked out. If a rule depends on width or height, test it on a fresh upload first. To change uploads ",[14,330,331],{},"before"," they're saved, use an ",[38,334,336],{"href":335},"\u002Fautomations\u002Fintake","intake workflow"," instead.",{"title":339,"searchDepth":340,"depth":341,"links":342},"",2,3,[343,344,345,346,347,348,349,350,351,352],{"id":50,"depth":341,"text":51},{"id":83,"depth":341,"text":84},{"id":108,"depth":341,"text":109},{"id":161,"depth":341,"text":162},{"id":200,"depth":341,"text":201},{"id":238,"depth":341,"text":239},{"id":256,"depth":341,"text":257},{"id":270,"depth":341,"text":271},{"id":289,"depth":340,"text":290},{"id":304,"depth":340,"text":305},"Build a library workflow that tags large images and files everything else away, then run it from Files.","md",{},{"icon":357},"i-lucide-rocket","\u002Fautomations\u002Ffirst-workflow",{"title":5,"description":353},"2.automations\u002F02.first-workflow","Jx8ncpyi7eLqQdtK22uGh1r5v0-M2VWNvDRr8GXixVg",[363,369],{"title":364,"path":365,"stem":366,"description":367,"icon":368,"children":-1},"Overview","\u002Fautomations","2.automations\u002F01.index","Workflows, triggers and steps, the two kinds of workflow, and how a draft becomes something that runs.","i-lucide-workflow",{"title":370,"path":371,"stem":372,"description":373,"icon":374,"children":-1},"The editor","\u002Fautomations\u002Feditor","2.automations\u002F03.editor","The canvas, the outline, the step picker, step settings, the Problems list and workflow settings.","i-lucide-mouse-pointer-2",[376,385],{"title":377,"path":378,"stem":379,"children":380,"icon":384},"Getting started","\u002Fgetting-started","1.getting-started\u002F1.index",[381],{"title":382,"path":378,"stem":379,"icon":383},"Introduction","i-lucide-house",false,{"title":57,"path":365,"stem":366,"children":386,"icon":384},[387,388,389,390,395,400,403,407,412,417,426],{"title":364,"path":365,"stem":366,"icon":368},{"title":5,"path":358,"stem":360,"icon":357},{"title":370,"path":371,"stem":372,"icon":374},{"title":391,"path":392,"stem":393,"icon":394},"Values and templates","\u002Fautomations\u002Fvalues","2.automations\u002F04.values","i-lucide-braces",{"title":396,"path":397,"stem":398,"icon":399},"Conditions and branching","\u002Fautomations\u002Fbranching","2.automations\u002F05.branching","i-lucide-split",{"title":253,"path":252,"stem":401,"icon":402},"2.automations\u002F06.testing","i-lucide-flask-conical",{"title":404,"path":335,"stem":405,"icon":406},"Upload intake","2.automations\u002F07.intake","i-lucide-inbox",{"title":408,"path":409,"stem":410,"icon":411},"Quarantine and failures","\u002Fautomations\u002Fquarantine","2.automations\u002F08.quarantine","i-lucide-shield-alert",{"title":413,"path":414,"stem":415,"icon":416},"Runs and history","\u002Fautomations\u002Fruns","2.automations\u002F09.runs","i-lucide-history",{"title":418,"icon":419,"path":420,"stem":421,"children":422,"page":384},"Guides","i-lucide-book-open","\u002Fautomations\u002Fguides","2.automations\u002F10.guides",[423],{"title":41,"path":40,"stem":424,"icon":425},"2.automations\u002F10.guides\u002F1.compress-uploads","i-lucide-file-image",{"title":427,"icon":428,"path":429,"stem":430,"children":431,"page":384},"Reference","i-lucide-library","\u002Fautomations\u002Freference","2.automations\u002F11.reference",[432,437],{"title":433,"path":434,"stem":435,"icon":436},"Step reference","\u002Fautomations\u002Freference\u002Fsteps","2.automations\u002F11.reference\u002F1.steps","i-lucide-blocks",{"title":438,"path":439,"stem":440,"icon":441},"Limits and errors","\u002Fautomations\u002Freference\u002Flimits","2.automations\u002F11.reference\u002F2.limits","i-lucide-gauge",1796146074618,"7701d6d7-f1dc-48af-abe7-a8319dcc587e"]