# Calling Gulp Tasks

If you need to call an existing Gulp task from Elixir, you may use the `task` method. As an example, imagine that you have a Gulp task that simply speaks a bit of text when called:

```
gulp.task( 'speak', function() {
    var message = 'Tea...Earl Grey...Hot';

    gulp.src( '' ).pipe( shell( 'say ' + message ) );
});
```

If you wish to call the `speak` task from Elixir, use the `mix.task` method and pass the `name` of the task as the only argument to the method:

```javascript
elixir( function( mix ){
    mix.task( 'speak' );
});
```

## Custom Watchers

If you need to register a watcher to run your custom task each time some files are modified, pass a regular expression as the second argument to the `task` method:

```
elixir( function( mix ){
    mix.task( 'speak', 'tests/**/*.cfc' );
});
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://coldbox-elixir.ortusbooks.com/v2/calling_gulp_tasks.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
