---
schema_version: "1"
id: 1bb61173af6c67ce82be8bc8f216df649f964ea0c7738d3b9c757fd584f07347
title: Create File
collection: mulesoft
version: current
locale: en-us
portal_url: https://docs.salesforce.com/mulesoft/current/en-us/rpa-builder/6.6/toolbox-file-operations-create-file.md
canonical_url: https://docs.mulesoft.com/rpa-builder/6.6/toolbox-file-operations-create-file
source_site: docs.mulesoft.com
content_type: documentation
content_hash: e0ea22609932fdeaf311f89ddad628aaa320d4756ca4db330a720b74b8a4c92c
description: MuleSoft Documentation Site
release: "6.6"
latest: false
---
---
product: RPA Builder
version: 6.6
---

# Create File

> For the full documentation index, see: https://docs.mulesoft.com/llms.txt

_Create File_ is used to create an empty file at the specified path.

## Properties

**File Operation Settings**

- **Create directory if it does not exist** If this option is enabled, _Create File_ creates either
  the specified relative directory or the whole specified path, if this does not already exist.

- **Directory path** This is where you enter the path to the directory where the file is to be
  created. You can specify an absolute or relative path. If a relative path is used, then the path
  relates to the _Base Path_ variable.

- **File Name** Enter the name of the file that is to be created here.

- **Force error if file exists** If this option has been enabled, an error message will interrupt
  the _Workflow_ if a file with the same name already exists. If this option has not been enabled
  and the file already exists, it will be replaced with an empty file and no acknowledgment will be
  given.

- **Open with associated application** If this option has been enabled, the newly created file will
  be opened with the application that is associated with the file name of the new file. For example,
  if the new file name ends in \*.txt it will normally be opened with Notepad.

Leave this option disabled if you want another _Action Step_ to be able to access the newly created
file – otherwise it will be locked.

Other Properties that are the same in all Action Steps are described in the section on **Common
Properties**. For reasons of clarity they are not shown here.

## Inbound Variables

- **Directory path** This is where you enter the path to the directory where the file is to be
  created. You can specify an absolute or relative path. If a relative path is used, then the path
  relates to the _Base Path_ variable.

- **File Name**\* Enter the name of the file that is to be created here.

## Outbound Variables

**IsCreated** The _Create File.IsCreated_ variable indicates whether the file could be created or
not (True/False).

**File name** The _Create File.File Name_ variable provides the name of the file that has been
created.

**Directory path** The _Create File.Directory Path_ variable provides the path that is used.

## Wizard

- **Directory path** Specify the path here to the file that is being newly created. You can create
  an absolute path or a path relative to the _Base Path_. The initial value is %STWS\_BASEPATH%. If
  you specify an absolute path and also enable the option **Create Directory if it does not exist**,
  the directory path will be created in full if it does not already exist. Select an existing path.
  You can also insert variables from the _Workflow_ in order to construct the path. To do so, click
  on the pin and select one of the available variables.

- **File name** Enter the name of the file here that is to be created. If you want the file to open
  with the associated program (option: Open created file with associated application), you must also
  specify a file extension. You can also insert a variable from the Workflow as the _File Name_. To
  do so, click on the pin and select one of the available variables.

- **Force error if file exists** If this option has been enabled, an error message will interrupt
  the _Workflow_ if a file with the same name already exists. If this option has not been enabled
  and the file already exists, it will be replaced with an empty file and no acknowledgment will be
  given.

- **Open with associated application** If this option has been enabled, the newly created file will
  be opened with the application that is associated with the file name of the new file. For example,
  if the new file name ends in \*.txt it will normally be opened with Notepad.

- **Create directory if it does not exist** If this option is enabled, _Create File_ creates either
  the specified relative directory or the whole specified path, if this does not already exist.

## Example

Create an empty file using the _Create File_ Action Step and write text to that file using the
_Write to Text File_ Action Step. The _Write to Text File_ Action Step can be pointed directly to
the newly created file using, for example, the _Create File.Directory Path_ and _Create
File.FileName_ variables. This allows you to create your own log file containing text that is of
interest to you.
