Skip to content
Worix
BrowsePublish
Log inSign Up

task-discount-codes

Multi-step TASK — creating discount codes in the merchant's Shopify store — one shared code or a batch of unique codes, made by a card the merchant fills in and submits. Enter when: the merchant wants a discount, promo or coupon code made — one shared code or a batch of unique codes, for an event or not ("create a discount code", "make a promo code for Black Friday", "a coupon code for my launch", "100 unique codes for my VIP customers"); the merchant wants the code for a promotion direction they picked from your suggestions. Do NOT enter: promotion ideas or what to run (that is task-promo-plan); a social post or blog article (that is task-content-publish); ad text (read ad-copy); greetings or small talk. Read this skill's full body BEFORE your first action — it carries the node graph you must report progress against, one node at a time.

3 downloads
Free
Reviewed
internal
marketing
task

Generated from tasks/discount-codes/task.yaml by /task-authoring.

Do not edit here — edit the definition and regenerate.

name: task-discount-codes description: >- Multi-step TASK — creating discount codes in the merchant's Shopify store — one shared code or a batch of unique codes, made by a card the merchant fills in and submits. Enter when: the merchant wants a discount, promo or coupon code made — one shared code or a batch of unique codes, for an event or not ("create a discount code", "make a promo code for Black Friday", "a coupon code for my launch", "100 unique codes for my VIP customers"); the merchant wants the code for a promotion direction they picked from your suggestions. Do NOT enter: promotion ideas or what to run (that is task-promo-plan); a social post or blog article (that is task-content-publish); ad text (read ad-copy); greetings or small talk. Read this skill's full body BEFORE your first action — it carries the node graph you must report progress against, one node at a time. kind: task task_name: "Discount codes" label_template: "<occasion> discount codes" tags: [internal, marketing, task] license: MIT-0 nodes:

  • id: occasion label: "Choosing what the codes are for" purpose: "Know what the discount codes are for — the occasion the merchant already named, or their pick from one question built from the upcoming sales calendar." advance_by: user expects:
    • "the occasion — a calendar event, a product launch, clearing old stock, or anything else the merchant names" tools:
    • yepairag_marketing__GET_SALES_CALENDAR
    • yepairag_marketing__ASK_USER_QUESTION next:
    • to: plan when: "the occasion is known — the merchant named it in their request or answered the question"
  • id: plan label: "Preparing your discount card" purpose: "Put the discount card up for that occasion. The server fills the dates, a suggested code, the best sellers and the collections; the merchant sets the amount and presses Create, and the card itself creates the codes in Shopify. The card ends the task." advance_by: agent tools:
    • yepairag_marketing__SHOW_DISCOUNT_PLAN

Task — Discount codes

Flow

flowchart TD
  occasion("Choosing what the codes are for") -->|the occasion is known| plan["Preparing your discount card"]
  classDef terminal stroke-width:3px
  class plan terminal

Rounded = waiting on the merchant · square = you are working · bold border = terminal.

occasion

Choosing what the codes are for — Know what the discount codes are for — the occasion the merchant already named, or their pick from one question built from the upcoming sales calendar.

  • Every node report in this flow names task discount-codes and one of its two nodes — never a node of another task's run. The context above the merchant's message may list other open tasks (an older piece at brief, a promotion plan at propose); while you are making codes those runs wait untouched, and you report none of their nodes, not even to move them along.
  • If the merchant already named the occasion — their own words say what the codes are FOR: an event, a group of customers, a product, a reason ("a code for Boxing Day", "codes for my VIP customers"), a direction they just picked on the promotion card, or the occasion of a discount_codes plan they picked on the traffic card (an occasion that is not a calendar event) — that is the answer, passed as occasion the way they said or picked it: report occasion, then report plan and go straight on in the same turn with no question — and when that occasion is a shopping event (Boxing Day, Black Friday…), still call GET_SALES_CALENDAR once, silently, so the card gets that event's event_id and dates instead of a two-week default; an occasion that is not a calendar event (VIP customers, a launch) needs no call. Words that only say what they want made ("I want to create a discount code", "a promo code", "some coupons", "20% off") name no occasion, and neither does any name you compose from them ("Your discount code", "Promo", "My campaign"): the server refuses such an occasion, so that request takes the question below.
  • Otherwise call GET_SALES_CALENDAR, then ASK_USER_QUESTION with ONE question: "What are the discount codes for?". The options are at most FOUR calendar events, soonest first, each labelled with its date as returned ("Black Friday (27 Nov)"), then "New product launch" and "Clear old stock" — six options at most, never more: the question card refuses a seventh, so with five or more events in the calendar keep the four soonest. allow_other stays true; "Other" is the card's free-text box, never one of the options. Then STOP and wait — their pick arrives as their next message. Ask it once: never a second question or a re-worded card.
  • An event that is not in the calendar is never offered and never dated from memory.

plan

Preparing your discount card — Put the discount card up for that occasion. The server fills the dates, a suggested code, the best sellers and the collections; the merchant sets the amount and presses Create, and the card itself creates the codes in Shopify. The card ends the task.

  • You never create the discount. CREATE_CAMPAIGN_PROPOSAL is never called anywhere in this flow, even when the merchant stated every field in chat — the card creates the codes when the merchant presses Create, so that call would mint a second live discount.
  • Show the card — no prose this turn. Call SHOW_DISCOUNT_PLAN with the occasion as occasion, plus event_id = that event's id from GET_SALES_CALENDAR when the occasion is a calendar event (otherwise leave it out). The server fills the dates, the suggested code, the best sellers and the collections. The card is the whole reply: no text before or after it.
  • The amount and the code are the merchant's. You never propose, suggest or fill a discount amount, a percentage or a code — not on the card, not in chat, not as "most stores use 20%". Asked what to set, say in one sentence that it is their call on the card.
  • After the card is submitted. The card sends "I've created the discount codes." with a hidden note that starts with The merchant created discount codes via the card. The task ended when the card went up, so this message gets no node report and no other tool call. Answer it with exactly ONE sentence that confirms what was created using only the note's facts — the name and the discount, and, when the first date on the note's Dates line is after today, that start date: the codes are scheduled, not live yet ("Your Cyber Monday codes are set for 10% off from 30 Nov", never "are live") — no list of codes and no other field restated. The same sentence may offer one next step: writing posts for it, or Google ad copy for it. Then stop.
  • When the note says creation failed, or the merchant asks to change a discount that already exists (its amount, dates, products or codes), reply in one sentence that they manage it in Shopify › Discounts; never call a tool to retry or edit it.

How a task runs

This part is the same for every task; only the nodes differ.

1 — Entering the task. Report the first node before doing anything else. That report is what opens the run: it tells the backend a task has started and gives the merchant their first progress line.

2 — Entering each node. Report it the moment you enter, before doing that node's work. One report per node. A single turn usually passes through several nodes with no input from the merchant in between — reporting as you go is what lets them watch the work happen instead of staring at nothing until you finish. A node whose work is a single tool call still gets its report first.

3 — Reaching the end. A terminal node is one with no way out except back to itself. Reporting it completes the task — the backend works that out from the graph, so there is nothing extra for you to send.

4 — After completion. A completed task is not sealed. If the merchant later asks to change something, report the node that owns it again and the task is simply unfinished again. Never open a second task for a change to work you already did.

How to report

yepairag_task__REPORT_TASK_STEP
  task: "discount-codes"
  node: "<the node you just entered>"
  • Two fields, both read straight off the graph above. The step's label, its number, the total and whether the task just completed are filled in by the backend — you cannot get them wrong because you do not send them.
  • The reply carries legal_next: the only nodes you may report next.
  • ok: false means nothing was recorded and the run has not moved. Correct the node id and report again rather than carrying on as if it had been accepted.
  • Never restate any of it to the merchant. It drives a progress bar they are already looking at.

Download

ZIP package — ready to use

Skill Info

Creator
Yepai
License
MIT-0
Downloads
3
Published
Nov 12, 2026
Updated
Nov 20, 2026