Neo4j DAG Cycle Breach and Hierarchy Integrity Gate
Detect directed cycle breaches in Neo4j hierarchy graphs, persist JSON audit certificates, and conditionally sever culprit back-edges.
Gate Timefold Platform optimization solves on hard constraint violations and alert Slack when a schedule or route is infeasible.
An optimized schedule or route plan that silently breaks a hard constraint, like double-booking an employee or missing a required skill, is worse than no plan at all, because it looks solved. This blueprint submits a dataset to the Timefold Platform, waits for the solver, and gates the result on its own reported score: any hard constraint violation pages Slack instead of letting the solution flow downstream unreviewed.
submit_and_solve (io.kestra.plugin.timefold.Solve) submits model_input_json to the selected model_type with wait: true, so the task blocks until the Timefold Platform finishes solving and returns jobId, solverStatus, and score. fetchType: NONE skips the full modelOutput since this gate only inspects the score. allowFailure: true means a connection or authentication failure still lets the flow continue instead of aborting.classify_solution_feasibility (io.kestra.plugin.core.debug.Return) checks whether outputs.submit_and_solve.score is defined; if not, UNREACHABLE. Otherwise it checks whether the score string starts with 0hard (Timefold's score format is {hard}hard/{medium}medium/{soft}soft), returning FEASIBLE or INFEASIBLE.route_by_feasibility (io.kestra.plugin.core.flow.Switch) branches on that string: FEASIBLE logs a quiet confirmation, INFEASIBLE pages Slack with the job id and score, UNREACHABLE pages Slack separately, and defaults logs the raw outcome.log_audit_status records a status line on every run regardless of branch, so the execution history is a continuous feasibility trend.errors block pages Slack separately if the flow itself fails outright.timefold_feasibility_gate_schedule trigger polls every 6 hours with explicit input overrides, shipped disabled: true until you add a real API key and dataset.status output (FEASIBLE / INFEASIBLE / UNREACHABLE) you can chart or gate other flows on.Calling the Timefold API from a script gets you a score once; this flow makes that score load-bearing. Every solve is recorded in the execution history, the feasibility check becomes a typed output other flows can depend on, and the Switch branch is one edit away from real remediation (blocking publication, re-submitting with relaxed constraints, opening a ticket) instead of a one-off check.
baseUrl defaults to the managed cloud (https://app.timefold.ai) and can be overridden for a self-hosted Timefold deployment; no standalone open-source Docker image exists for the managed Platform API this blueprint targets, and the plugin's own documentation does not state whether a free tier exists, so treat API access as UNVERIFIED without checking current Timefold pricing.TIMEFOLD_API_KEY: Timefold Platform API key, sent as the X-API-KEY header.SLACK_WEBHOOK_URL: Slack incoming webhook used for the infeasible alert, the unreachable alert, and the flow-failure alert.SECRET_TIMEFOLD_API_KEY and SECRET_SLACK_WEBHOOK_URL as base64, for example echo -n "<your-api-key>" | base64 and echo -n "<your-webhook-url>" | base64.TIMEFOLD_API_KEY and SLACK_WEBHOOK_URL secrets.model_type and model_input_json to a real dataset for your model.status reads FEASIBLE for a valid dataset.timefold_feasibility_gate_schedule.medium and soft components of the score too, and classify a WARNING tier for solutions that are feasible but score poorly on soft constraints.wait: false and a longer solveDuration when a first attempt is infeasible.Loop task to gate an entire batch of schedules or route plans in one run.