DEV Community

Cover image for AI automation: pick your first task from a time log, not from a wish list
MatIntellect
MatIntellect

Posted on Edited on Originally published at matintellect.com AI-assisted

AI automation: pick your first task from a time log, not from a wish list

Problem: teams start AI automation with the most exciting task, which usually has a fuzzy input and a result nobody can verify, and the project stalls. Result of this article: a small script that reads a week of time tracking, filters tasks by three rules and names the first task worth automating. Stack: plain Python 3.10+ (tested on 3.15.2), no external packages. Boundaries: the script does not automate anything; it only makes the choice explicit and repeatable. The task data and time log in the example are invented for teaching

AI-generated illustration of AI automation and where to start

Where the rules come from

My own automation is built from simple tasks with a clear input and output. Every morning I get one message with the plan for the day, assembled from the calendar, tasks and reminders; it has arrived for 127 days in a row. Reminders are checked every 5 minutes, and the system has sent 240 reminders so far

The harder piece, calls, came later and sits on top of those simple pieces. A 57-minute recording becomes a transcript in about 10 minutes, followed by a summary, tasks and a client card in the CRM. About 40 calls with 15 clients have gone through it. It worked because it follows the same rules as the simple tasks: a clear input, a clear output and a result I can check

The script below turns those rules into code so you can apply them to your own week

Input, processing, output

Input: a list of tasks with four properties each (how long it takes to explain to a new hire, how long it takes to check one result, whether the input is clear, whether the output is clear) and a time log of task name and minutes

Processing: minutes are summed per task and tasks are ranked by total time. Each task is checked against three rules: explainable in five minutes, checkable within a minute, clear input and output. The first task in the ranking that passes all three is the answer

Output: one line per task with its weekly minutes and a verdict, then the chosen task

The ranking runs before the filter on purpose. You want to see that the biggest time sink was rejected and why, rather than having it silently vanish from the list

Email on a laptop next to a paper planner

The example

from collections import defaultdict
from dataclasses import dataclass

@dataclass
class Task:
    name: str
    explain_minutes: int   # time to explain it to a new hire
    check_seconds: int     # time to verify one result
    has_input: bool
    has_output: bool

TASKS = {
    "sort email": Task("sort email", 5, 30, True, True),
    "daily task list": Task("daily task list", 3, 20, True, True),
    "triage requests": Task("triage requests", 5, 60, True, True),
    "negotiate with suppliers": Task("negotiate with suppliers", 60, 900, True, False),
}

def passes(t: Task) -> list[str]:
    why = []
    if t.explain_minutes > 5:
        why.append("takes more than 5 minutes to explain")
    if t.check_seconds > 60:
        why.append("result is not checkable at a glance")
    if not (t.has_input and t.has_output):
        why.append("input or output is unclear")
    return why

def pick(log, tasks):
    minutes = defaultdict(int)
    for name, m in log:
        minutes[name] += m
    ranked = sorted(minutes.items(), key=lambda kv: kv[1], reverse=True)
    first = None
    for name, total in ranked:
        why = passes(tasks[name])
        verdict = "ok" if not why else "skip: " + "; ".join(why)
        print(f"{name:26} {total:4} min/week  {verdict}")
        if not why and first is None:
            first = name
    return first

if __name__ == "__main__":
    print("first task to automate:", pick(LOG, TASKS))
Enter fullscreen mode Exit fullscreen mode

Output, exactly as it printed when I ran it:

sort email                  245 min/week  ok
negotiate with suppliers    150 min/week  skip: takes more than 5 minutes to explain; result is not checkable at a glance; input or output is unclear
triage requests             140 min/week  ok
daily task list              85 min/week  ok
first task to automate: sort email
Enter fullscreen mode Exit fullscreen mode

Design notes

The thresholds are judgement, not science. Five minutes to explain is the rule of thumb from my article; one minute to check is a number chosen for this example. Adjust both, but write them down so the choice is not made by mood

Supplier negotiation took more time than triage in the example log and was still rejected. That is the point of the filter: a large time sink with no verifiable result is a bad first project, however tempting

Keep the reasons. "Skip" alone hides the useful information. The reasons tell you what would have to change for a task to qualify later, for example writing down what a good negotiation outcome looks like

Re-run it monthly. Once the first task is automated, its minutes drop and the next candidate rises to the top

Errors and trade-offs

A short log misleads. Two days can make a weekly task look daily or hide it entirely. Log at least a full working week

Self-reported properties are optimistic. People tend to believe their tasks are easier to explain than they are. Ask someone else to read your one-line description and say whether they could do the task from it

Broken sources poison the result. If requests already get lost in the inbox, the triage task passes the filter but automation will lose requests faster. Fix the source before the automation, not after

Time is not the only cost. A task with a small time cost but frequent mistakes may deserve attention first. The script ignores that by design; add a column if it matters in your case

Working through a task list on a laptop

How to reproduce the check

  1. Save the example as pick.py
  2. Run python3 pick.py with Python 3.10 or newer
  3. Compare the output with the block above
  4. Replace TASKS and LOG with one week of your own tracking and run it again

For the non-technical version of the same advice, including examples of inputs and outputs for common tasks, see AI automation: where to start

This article was created with the help of AI.

Top comments (0)