Files
windmill/backend/migrations/20220902211654_job-resume.up.sql
sqwishy a4a583f4e3 feat(backend): flow suspend resume (#522)
Flow observes `suspend` setting and will wait for resume messages sent for the job before continuing to the next step in a flow.

Adds endpoints under workspaces at `/jobs/<cancel|resume>/<job-uuid>` to either cancel or resume the job with a payload. For POST requests to the endpoint, payload is a JSON document. For GET requests to the endpoints, the payload is a base64url encoded JSON document as the value of the payload query parameter.
2022-09-14 11:46:57 -07:00

17 lines
609 B
SQL

CREATE TABLE resume_job (
id uuid NOT NULL,
job uuid NOT NULL,
flow uuid NOT NULL,
created_at TIMESTAMPTZ NOT NULL DEFAULT now(),
value JSONB NOT NULL DEFAULT 'null'::jsonb
CHECK (length(value::text) < 10 * 1024),
is_cancel boolean NOT NULL default false,
PRIMARY KEY (id),
FOREIGN KEY (flow) REFERENCES queue(id) ON DELETE CASCADE
);
ALTER TABLE queue
ADD COLUMN suspend INTEGER NOT NULL DEFAULT 0,
ADD COLUMN suspend_until TIMESTAMPTZ;