Create email folder

Email inbox
Create email folder
Success
Credentials(Email credentials)
Error
Path
Folder(Email folder)

Description

Creates a folder on a mail server and returns it. Creating a folder that already exists succeeds and returns the existing folder, so this is safe to run on every execution. Use the server's hierarchy separator in the path (usually / or .). Branches on success/error.

When to use

Use Create email folder to make sure a destination exists before moving messages into it. Creating a folder that is already there is not an error — the node returns the existing folder — so you can run it unconditionally at the top of a pipeline instead of listing folders and branching on whether yours is present.

Get the separator right. Most servers use /, but Courier and some Dovecot configurations use ., and a path with the wrong one silently creates a single folder with a literal dot or slash in its name rather than a nested one. Run Find email folders once and look at an existing nested path to see which the server uses.

Creating a folder per month or per customer is a reasonable pattern; just remember that folders are cheap to make and awkward to clean up, so derive the name from something bounded.

Pins

Input pins

Pin Type Default Notes
Credentials Email credentials — Email credentials produced by any of the three email credentials nodes.
Path string — Full path of the folder to create, using the server's hierarchy separator — `INBOX/Processed` on most servers, `INBOX.Processed` on some. Must not be blank. Run Find email folders first to see which separator the server uses.

Output pins

Pin Type Notes
Folder Email folder The folder, whether it was just created or already existed. Break it to read its name, path and role, or feed its `path` into Move email.

Execution pins

Pin Direction
In Input
Success Output
Error Output

Example

Archive processed orders by month. At the top of the pipeline, build the path with Now → Format datetime (yyyy-MM) and Concatenate it onto INBOX/Processed/, then wire that into Create email folder. Keep the resulting folder’s path in a local variable and feed it into Move email inside the per-message loop.

See also