Custom approval page logo

Custom approval page

Project
0
by · 3 items · 1 flow · 1 app · 1 resource slack

README

Description

A flow approval step that sends approvers to a fully branded approval page instead of the built-in one. The request is posted to Slack with a button to the page, and the decision is reported back in the Slack thread.

Everything runs on the Community Edition: the page is a public full-code app (React) talking to the two public approval endpoints, and the flow uses a plain approval step.

What's inside

  • expense_request flow: posts the request to Slack, suspends until approved or rejected, then replies with the outcome.
  • approval_page app: the branded page approvers open. No Windmill account needed.
  • slack resource: the bot token used to post, pointing at the variable the workspace Slack connection creates.

How it works

  1. The approval step calls getResumeUrls(), keeps the job id and approval token from the built-in page URL, and builds a link to the public app instead: /public/<workspace>/<secret>#job=<id>&token=<token>.
  2. The step posts that link to Slack and returns description, the object the page displays.
  3. The app's backend runnables call jobs_u/flow/approval_info to read the request and jobs_u/flow/resume_suspended to approve or reject, without their own credentials, so the approval token stays the only authorization.
  4. The form values reach the next step as resume, and approvers lists who decided. Rejections continue the flow too, so they are reported in the thread.

Usage

  1. Connect the workspace to Slack in Workspace settings > Slack, or point the slack resource at any bot token with chat:write.
  2. Invite the bot to the channel it should post in.
  3. Open the app once in the editor and deploy it.
  4. Run the flow with an amount, purpose, requester and channel. Open the link from the Slack message, approve or reject, and watch the thread.

Branding: edit brand.ts (name, tagline, logo, footer) and the :root block of index.css (colors, radius, font) in the app.

Steps that require approvers to be logged in need a Windmill session and cannot be approved from a public page; the page detects that case and says so.