<p>I'm not aware of any articles or best practice documents.</p>

<p>There is a sample/simple <a href="https://github.com/pixelandtonic/PowerNap/" rel="noreferrer">PowerNap</a> plugin that shows the basics of creating and running a task as well as the <a href="http://buildwithcraft.com/classreference/services/TasksService" rel="noreferrer">TaskService</a> class reference documentation which you've already found.</p>

CC BY-SA 3.0
2015-08-30T16:51:17.690Z
One other headache I had when creating a task for a custom plugin - make sure you name the file/class for your task to be prefixed with the plugin name (which is a standard Craft convention). Something like `MyPlugin_BeAwesomeTask.php`.
Benjamin Smith
CC BY-SA 3.0
2015-02-26T16:46:29.860Z
2015-02-26T16:46:29.860Z
Brad Bell
<p>I'm looking to integrate tasks into a plugin I'm building. Whilst I know that the Craft documentation shows the Tasks Service/Model properties/methods in the full class reference, I can't find anything online about best practices regarding using tasks in plugins. Has anyone come across any articles about creating your own tasks?</p>

<plugin-development><plugins><tasks>
Documentation on creating tasks
# Documentation on creating tasks

(Asked by: username_0 on 2015-02-26)

I'm looking to integrate tasks into a plugin I'm building. Whilst I know that the Craft documentation shows the Tasks Service/Model properties/methods in the full class reference, I can't find anything online about best practices regarding using tasks in plugins. Has anyone come across any articles about creating your own tasks?

**Tags:** plugin-development, plugins, tasks


---

## 1 answers

### Answer by username_1 on 2015-02-26. Score: 5

I'm not aware of any articles or best practice documents.

There is a sample/simple [PowerNap](https://github.com/pixelandtonic/PowerNap/) plugin that shows the basics of creating and running a task as well as the [TaskService](http://buildwithcraft.com/classreference/services/TasksService) class reference documentation which you've already found.

> **Comments:**
> **username_2**: One other headache I had when creating a task for a custom plugin - make sure you name the file/class for your task to be prefixed with the plugin name (which is a standard Craft convention). Something like `MyPlugin_BeAwesomeTask.php`.  

---

