Send rich Discord notifications
Post a formatted message to a Discord channel for every upload, with its name, size, date, a share link and a preview image.
When you upload from several machines, or share an Avenvail server with someone, it helps to see new files where you already are. This guide builds a library workflow that posts every new image to a Discord channel: a titled message that links to a share link, the file's details, and a small preview attached. It's a good introduction to templates, which put values from the run into text.
- File uploaded (trigger)PNG, JPEG, WebP and GIF
- Create share linkExpires after 7 days
- Load content
- Make a previewResize to fit 1280 × 1280
- Convert imageWebP, quality 80
- Post to DiscordNew upload: {{ subject.name }}
What you'll build
Uploading sharex-window-capture.png posts this to the channel (verified text; the time depends on when you upload):
New upload: sharex-window-capture.png (links to the share link)
sharex-window-capture.png was uploaded to All files.
- Size: 880.4 KB
- Dimensions: 2560 × 1400 px
- Uploaded: Dec 2, 2026 21:35
- Link expires: Dec 9, 2026
🖼 A 1280 × 700 WebP preview, attached
Before you start
| Difficulty | Beginner |
| Time | About 10 minutes |
| Workflow kind | Library workflow |
| Connections | A Discord webhook |
| Folders, tags, fields | None |
| Sample file | Any image, such as sharex-window-capture.png |
You need permission to manage webhooks in the Discord channel.
Build the workflow
Create the Discord connection
In Discord, open the channel's settings, go to Integrations › Webhooks, create a webhook and click Copy Webhook URL.
In Avenvail, open Automations › Connections, click Add connection, choose Discord webhook and paste the URL as the Webhook URL. Name it after the channel, such as #uploads. Click Test connection: it reads the webhook's details without posting anything. Then click Add connection.
The URL is stored encrypted and never shown again; anyone with it can post to the channel. See Discord webhook for Post as and the other settings.
Create the workflow
Open Automations › Workflows, click New workflow, name it Post uploads to Discord, keep Library workflow, and choose File uploaded as the trigger.
Set the trigger's File types to image/png, image/jpeg, image/webp and image/gif. The preview steps only work on images; Post every file shows how to include other files.
Create a share link
Add a Create share link step after the trigger and set Expires after to P7D, which is 7 days. Leave it empty for a link that never expires.
Each run makes a new link. Links from a ShareX token's own setting are separate and stay as they are.
Make a small preview
Add these three steps after it, each with the + after the one before:
- Load content, which reads the saved image without changing it.
- Resize, renamed Make a preview: Content Load content › Content, Max width
1280, Max height1280. - Convert image: Content Make a preview › Content, Format WebP, Quality
80.
These work on a copy. The file in your library stays as it is. The preview keeps the attachment well under Discord's 10 MiB limit, even for large screenshots.
Write the message
Add a Send notification step after Convert image, rename it Post to Discord, and pick your Discord connection as its Connection.
Message is a template. Type the text, and insert values by typing {{ and picking them from the list, or with Insert value. Because Discord shows Markdown, the editor formats as you type. Paste this into Edit as source (</>) to get the same message:
**{{ subject.name }}** was uploaded to {{ subject.folder.path | default: 'All files' }}.
- **Size:** {{ subject.size | size }}
- **Dimensions:** {{ subject.width }} × {{ subject.height }} px
- **Uploaded:** {{ subject.createdAt | date: 'MMM d, yyyy HH:mm' }}
- **Link expires:** {{ steps.create-share.expiresAt | date: 'MMM d, yyyy' }}
What each value does:
| Value | Shows |
|---|---|
subject.name | The file's name. subject is the run's file as it is now. |
subject.folder.path | default: 'All files' | The folder's path, such as Screenshots/2026. A file at the top of the library has no folder, so default fills in All files; without it, the step would fail. |
subject.size | size | The size in bytes, formatted as 880.4 KB. |
subject.createdAt | date: '…' | When the file was uploaded, formatted with a .NET date format. |
steps.create-share.expiresAt | When the link stops working, from the Create share link step. If you removed Expires after, remove this line too: a link that never expires has no date, and the step would fail. |
create-share is the id Avenvail gave the Create share link step. A second step of the same kind gets -2 added, so if you've added steps in another order, pick the value from the list instead of typing it; each step's Outputs shows its exact reference.
Add a title, link and preview
Open More message options:
- Title: a template,
New upload: {{ subject.name }}. - Link: switch to From a step and pick Create share link › URL. The title then links to the share page.
Open Attachment and set File to Convert image › Content.
With a title, Discord shows the message as an embed and takes up to 4,096 characters instead of 2,000.
Test it
- Click Test, choose an image from your library, and click Start test.
- Select Post to Discord. Its history shows the message with every value filled in, as Discord would receive it, and a placeholder message id. A test doesn't post anything unless you turn on Allow outside changes, and the share link it makes is a placeholder.
- Turn on Allow outside changes and test again to see the real message in the channel. The message is really posted, but the share link in it is still a placeholder that doesn't open.
Turn it on
Click Publish, then turn on Active. Upload an image and the message appears in the channel within a few seconds.
Uploads that go through an intake workflow, such as Optimize ShareX uploads, are posted once they're saved, so the message shows the optimized size.
What to expect
The run page shows each step succeeded. Post to Discord records the message id Discord returned. Values from the sample's verified test run:
| Step | Output |
|---|---|
| Create share link | url: a /s/… link, expiresAt: 7 days after the upload |
| Make a preview | A 1280 × 700 copy |
| Convert image | The copy as WebP |
| Post to Discord | messageId |
Troubleshooting
| Problem | Cause and fix |
|---|---|
input_missing on Post to Discord | A value in the message has nothing in it for this file, such as subject.width on a file that isn't an image, or the folder of a file at the top level without default. Add | default: '…' to that value, or | optional to leave it out. |
template_value_invalid | A value passed to date isn't a date. Pick the value again from the list. |
connection_auth_failed | The webhook was deleted in Discord. Create a new one and paste its URL into the connection. |
input_invalid: attachments over 10 MiB | The attachment is too big. Keep the preview steps, or lower their size. |
| The message is too long | The step fails and says how much Discord takes. Shorten the text, or add a title to raise the limit. |
| The run waits for you, Needs attention | Discord didn't answer clearly, so Avenvail can't tell whether the message was posted. Check the channel, then choose It went through or Send again. See Steps that need confirmation. |
| Dates are a few hours off | Templates format dates in the workflow's time zone, UTC by default. Set Time zone in the workflow's Settings tab. |
| Every upload posts, even ones you didn't want | Limit the trigger with File types or Folder, or add a Condition before Create share link, such as Current file › Tags contains share. |
Make it your own
Post every file
Remove the image-only File types, then add a Condition after Create share link with the rule Current file › Category equals image. Put the preview steps and a Send notification with the attachment on True, and a second Send notification without the attachment, and without the dimensions line, on False.
Only notify for some folders
Set the trigger's Folder, for example to Shared with team. Only uploads into that folder post a message.
Mention who uploaded it
On a server with several users, each user's workflows run on their own uploads. Add Uploaded by **{{ owner.username }}** to the message.
Use a webhook instead
To send the same details to another service, such as a home automation hub, use Send webhook with a JSON Body. See Send webhook.
Privacy, cost and reliability
- The message, the title, the share link and the preview image are sent to Discord and stored there under Discord's terms. Everyone in the channel can open the share link until it expires.
- Discord never pings anyone from these messages, even when a file name contains
@everyone. - Sending a notification is never retried automatically when it's unclear whether Discord received it, so a message is never posted twice without you choosing to. Discord rate limits make the step wait, not fail.
- To cap how many messages a workflow can post, set Requests a minute or Requests a day on the connection. See Usage limits.