--- alias: user-guide-automation-task-filedrivers-newfileevent tags: - automation tasks description: "This task listens for new file events, emitting data about the created file" --- # New File Event ![Screenshot showing a new file creation event.](images/eventfilecreated-lg.svg) This task, when initialized, subscribes to the `new file event`. The task outputs will be filled with the data received from the file driver. ![Screenshot showing a new file event dialog with fields for Date Time, FileName, and Filename hint.](./images/image32.png) ## Inputs | Name | DataType | Description | |----------|----------|-----------------------------| | Activate | `any` | Enables the event listening | !!! note Although the drawn Task box indicates the `Activate` input is of type `any` it will act based on the converted value to `Boolean`. The visual information will be fixed in a future version. ## Outputs | Name | DataType | Description | | ------ | --------- | --------- | | eventRawData | `any` | Triggered when an event occurs. Used to output the received data | | timestamp | `DateTime` | Triggered when an event occurs. Used to output the time of occurrence | | fileName | `String` | Triggered when an event occurs. Used to output the name of the created file | | relativePath | `String` | Triggered when an event occurs. Used to output the relative path of the created file | | fullPath | `String` | Triggered when an event occurs. Used to output the path of the created file | | size :material-pencil-circle: | `Integer` | Triggered when an event occurs. Used to output the size of the created file | | isFile :material-pencil-circle: | `Boolean` | Triggered when an event occurs. Used to output if the change is relative to a file | | isDirectory :material-pencil-circle: | `Boolean` | Triggered when an event occurs. Used to output if the change is relative to a directory | | accessedAt :material-pencil-circle: | `DateTime` | Triggered when an event occurs. Used to output when the file was last accessed | | createdAt :material-pencil-circle: | `DateTime` | Triggered when an event occurs. Used to output when the file was created | | updatedAt :material-pencil-circle: | `DateTime` | Triggered when an event occurs. Used to output when the file was last updated | | Success | `Boolean` | Triggered when the task is executed with success | | Error | `Error` | Triggered when the task failed for some reason | !!! note These properties may only be updated if the `alwaysStat` setting is set to `true` ## Settings On the `General` tab, you have the usual settings and the following settings: | Name | DataType | Values | Default | Description | | ------ | --------- | --------- | --------- | --------- | | Auto Activate | `Boolean` | | True | If the event is automatically activated or if it is only activated by the `activate` input | ![Screenshot showing settings for new file events.](./images/image33.png) ## Behavior In this task you choose a driver when dropping it into the workflow (if you have more than one driver associated with the controller). The task will become available (listening to the event(s)) on one of the following conditions: - `Auto Activate` setting is set to `true` - `Activate` input is fed with a `true` Boolean value (or compatible, like `1`, `true`, `t`, `yes`, `y`) Upon activation, when the `new file event` occurs every property associated with it will have its value emitted. ## Remarks The timing when it will be triggered may depend on some settings, like `watcherMode`, `awaitWriteFinish`, `awaitWriteFinishStabilityThreshold` and others. {% include-markdown 'includes/pages/automation_zones_note.md' %}