Skip to content
Merged
2 changes: 1 addition & 1 deletion DEVLOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -642,7 +642,7 @@ Todo:
- [x] Attach workflows from the pipeline editor
- [x] Content-type mapping on the Pipelines page (By content type)
- [x] Asset converter steps (video → audio, document → images) as pipeline steps (the convert step, conversions.py)
- [ ] Workflow node types: HTTP call, template render, entity filter
- [x] Workflow node types: HTTP call, template render, entity filter (HTTP call and entity filter added 2026-10-18; template render is the template primitive)
- [x] Docs: processing.md section on workflows

Content types (2026-10-02, follow-up in the same PR):
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,8 @@ listed under [In progress](#in-progress), and what comes next under [Planned](#p
workflow, pipeline or routine, or change assets and notes. The Schedules page is Lens's crontab: every routine,
automation schedule and the backup in one list with when each runs next and last, to switch, re-time or run now, and
agents do the same over the API and MCP. A Classify node in a workflow sorts an asset into labels, content types or
topics, acting only on a sure answer, and an Entity filter node keeps the entities you want. Graph workflows tidy the
topics, acting only on a sure answer, and an Entity filter node keeps the entities you want. An HTTP call node calls
a web address through the same guard as the assistant's web tools, with its keys sealed to their host. Graph workflows tidy the
entities on a routine: look-alikes to merge or link, types the rules now read differently, noise to hide and topics
to group under a broader one, making the changes they're sure of and proposing the rest, each one undoable. Anything that reaches outside Lens or changes
more than what set it off asks first, until you let it run on its own: on the Approvals page or, for a change inside
Expand Down
2 changes: 1 addition & 1 deletion docs/activity.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ its namespace, its pipeline and the routine. A request counts for the resources

Besides the resources, a row has its kind (`in`, `out` or `run`), what it was (`POST /api/v1/routines/{rid}`,
`model.chat`, `model.describe` (a picture Florence-2 or Moondream described on this server), `embeddings`, `decision`,
`notify.webhook`, `tool.http`, `web.search`, `web.read`, `google.token`, `gmail.list`, `job.succeeded`,
`notify.webhook`, `tool.http`, `workflow.http`, `web.search`, `web.read`, `google.token`, `gmail.list`, `job.succeeded`,
`routine.done`), the model, tokens in and out, the estimated cost in USD, how long it took, and how it ended (an error's type or HTTP status,
never its message). It never holds prompt, reply, asset text or file content.

Expand Down
14 changes: 14 additions & 0 deletions docs/processing.md
Original file line number Diff line number Diff line change
Expand Up @@ -774,6 +774,20 @@ node passes what it makes along its connections.
`confidence`, `sure` and `ranked`, so a Condition or Switch can branch on them; [classifying](#classifying)), Pick
(a path like `action_items.0.text`), Condition (yes and no branches; one test, or a
[match tree](automations.md#match-trees) of several) and Merge.
- **Web:** HTTP call sends GET, POST, PUT, PATCH or DELETE to a web address and passes on the answer (`status`, `ok`,
`url`, `content_type`, `body`, and `json` when it is JSON, up to 200,000 characters), so a Condition can branch on
`ok` and a Pick or template can read the JSON. The address, header values and body are templates (what came in is
`{{ input }}`: `https://api.example.com/search?q={{ input | urlencode }}`), but the scheme, host and port are written
out, so what flows through a workflow never decides where it goes. It goes out as the assistant's web tools do:
through Lens's network guard, to public addresses on ports 80 and 443 only (or the private networks an admin allowed
in Settings → Documents), every redirect checked again. Headers that carry credentials (Authorization, cookies, API
keys and tokens) are sealed with the server's key when the workflow is saved, bound to that header and that host, and
shown as `••••`; a redirect to another server doesn't get them. A 4xx or 5xx answer is passed on with `ok` false; an
address that can't be reached fails the node. Each call is a `workflow.http` row in the [activity ledger](activity.md)
(the host and method, never what was sent). A try on the canvas sends a GET but only says what it would send for the
other methods. Asset and graph workflows have it; automations call web addresses with their own action, which asks
first ([actions](automations.md#actions-and-intents)). Refine later: credentials passed in through a custom node's parameter
aren't sealed, and a sealed header is bound to its host rather than to one workflow.
- **Keeping results:** Save output (`outputs.<name>`), Set field (a custom field, kept in the metadata history), Save
entities, and a Classify node set to act on a sure answer (it sets the content type, suggests the topic or adds the
tag; a try on the canvas only says what it would do).
Expand Down
1 change: 1 addition & 0 deletions docs/requirements.md
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,7 @@ request, to another check that proves the same thing; loosening a requirement or
| Convert steps make new assets: a video's soundtrack as audio, a document's pages as images, each run through its own pipeline | [test_conversions.py](https://github.com/adeelahmad/lense/blob/main/fastapi_backend/tests/api/test_conversions.py) `test_a_videos_soundtrack_becomes_an_audio_asset`, `test_a_documents_pages_become_image_assets`, `test_settings_are_checked`; [pipeline-convert.test.ts](https://github.com/adeelahmad/lense/blob/main/nextjs-frontend/__tests__/pipeline-convert.test.ts) `is added from the library ready to run: to audio unless images are picked` |
| A Classify node in workflows chooses from labels, content types or topics, and acting on a sure answer keeps something | [test_classify.py](https://github.com/adeelahmad/lense/blob/main/fastapi_backend/tests/api/test_classify.py) `test_a_workflow_classifies`; [workflow-flow.test.ts](https://github.com/adeelahmad/lense/blob/main/nextjs-frontend/__tests__/workflow-flow.test.ts) `chooses from labels, content types or topics, and acting on a sure answer keeps something` |
| An Entity filter node keeps a list's entities by type, stop list, length, pattern or how often they're said | [test_flow.py](https://github.com/adeelahmad/lense/blob/main/fastapi_backend/tests/api/test_flow.py) `test_entity_filter_keeps_the_entities_asked_for`; [workflow-flow.test.ts](https://github.com/adeelahmad/lense/blob/main/nextjs-frontend/__tests__/workflow-flow.test.ts) `an entity filter says what it keeps and refuses lowercase types` |
| An HTTP call node calls a web address through the web tools' guard, with its host written out, its credentials sealed to their host, and a try that only reads | [test_http_nodes.py](https://github.com/adeelahmad/lense/blob/main/fastapi_backend/tests/api/test_http_nodes.py) `test_it_calls_the_address_and_passes_the_answer_on`, `test_where_it_goes_is_written_out_and_guarded`, `test_a_try_only_reads`; [workflow-flow.test.ts](https://github.com/adeelahmad/lense/blob/main/nextjs-frontend/__tests__/workflow-flow.test.ts) `an HTTP call node's host is written out` |
| Routines on a schedule | [test_routines.py](https://github.com/adeelahmad/lense/blob/main/fastapi_backend/tests/api/test_routines.py) `test_routines_are_checked_and_run_when_due`, `test_schedules`; [journeys.mjs](https://github.com/adeelahmad/lense/blob/main/ci/clicks/journeys.mjs) `routine-create`; [baseline.json](https://github.com/adeelahmad/lense/blob/main/ci/clicks/baseline.json) `routine-create` ≤ 2 clicks |
| Graph workflows find look-alikes to merge or link, wrong types, noise and topics to group, make the sure changes and propose the rest, each undoable and not made again once taken back | [test_routines.py](https://github.com/adeelahmad/lense/blob/main/fastapi_backend/tests/api/test_routines.py) `test_graph_workflows_organise_entities`, `test_rules_read_types_and_noise`, `test_graph_workflows_retype_and_hide`, `test_graph_workflows_group_topics`; [graph-changes.test.tsx](https://github.com/adeelahmad/lense/blob/main/nextjs-frontend/__tests__/graph-changes.test.tsx) `say a type change in words and make it`, `show a group of topics under a new broader one` |
| Everything that runs on a clock (routines, automations' schedule and at triggers, the backup) in one Schedules list, switched, re-timed and run from it, by people and by agents over the API and MCP | [test_schedules.py](https://github.com/adeelahmad/lense/blob/main/fastapi_backend/tests/api/test_schedules.py) `test_one_list_holds_every_routine_automation_schedule_and_the_backup`, `test_schedules_are_changed_switched_and_run_from_the_list`, `test_agents_list_change_and_run_schedules_over_mcp`; [schedules-page.test.tsx](https://github.com/adeelahmad/lense/blob/main/nextjs-frontend/__tests__/schedules-page.test.tsx) `lists every routine, automation schedule and the backup, each linking to its own page`, `switches one off, runs one now and changes when one runs, from the list` |
Expand Down
13 changes: 10 additions & 3 deletions fastapi_backend/app/domain/feeds.py
Original file line number Diff line number Diff line change
Expand Up @@ -428,17 +428,24 @@ def _url(cfg, src):
return url


class OtherServer(urllib.error.HTTPError):
"""A redirect not followed: it goes to another server, which isn't given the request's credentials."""


class _Redirects(urllib.request.HTTPRedirectHandler):
"""Follows a calendar's redirects, but not with its password to another server (or to plain http)."""
"""Follows redirects, but not with a password or any other credential header (an API key, a token, a cookie:
actions_web.secret) to another server (or to plain http)."""

def redirect_request(self, req, fp, code, msg, headers, newurl):
from .actions_web import secret # loaded here: the automation actions load what loads this

new = super().redirect_request(req, fp, code, msg, headers, newurl)
if new is not None and req.has_header("Authorization"):
if new is not None and any(secret(k) for k in req.headers):
a, b = urllib.parse.urlsplit(req.full_url), urllib.parse.urlsplit(new.full_url)
same = (a.hostname, a.port) == (b.hostname, b.port) and (a.scheme == b.scheme or b.scheme == "https")
if not same:
why = "it redirects to another server, which isn't given its password: use the address it ends at"
raise urllib.error.HTTPError(newurl, code, why, headers, fp)
raise OtherServer(newurl, code, why, headers, fp)
return new


Expand Down
Loading
Loading