{"action":"opened","issue":{"url":"https://api.github.com/repos/spotify/styx/issues/545","repository_url":"https://api.github.com/repos/spotify/styx","labels_url":"https://api.github.com/repos/spotify/styx/issues/545/labels{/name}","comments_url":"https://api.github.com/repos/spotify/styx/issues/545/comments","events_url":"https://api.github.com/repos/spotify/styx/issues/545/events","html_url":"https://github.com/spotify/styx/issues/545","id":350075390,"node_id":"MDU6SXNzdWUzNTAwNzUzOTA=","number":545,"title":"Initial workflow happens after \"offset\" interval which means a long wait time for larger offsets","user":{"login":"anish749","id":15274312,"node_id":"MDQ6VXNlcjE1Mjc0MzEy","avatar_url":"https://avatars3.githubusercontent.com/u/15274312?v=4","gravatar_id":"","url":"https://api.github.com/users/anish749","html_url":"https://github.com/anish749","followers_url":"https://api.github.com/users/anish749/followers","following_url":"https://api.github.com/users/anish749/following{/other_user}","gists_url":"https://api.github.com/users/anish749/gists{/gist_id}","starred_url":"https://api.github.com/users/anish749/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anish749/subscriptions","organizations_url":"https://api.github.com/users/anish749/orgs","repos_url":"https://api.github.com/users/anish749/repos","events_url":"https://api.github.com/users/anish749/events{/privacy}","received_events_url":"https://api.github.com/users/anish749/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-08-13T15:19:03Z","updated_at":"2018-08-13T15:19:03Z","closed_at":null,"author_association":"NONE","body":"During workflow initialisation, the next trigger instant is `offset` duration _after_ the current time. This means that for larger values of offset (like 30 days, 90 days) the natural trigger would be after 30 days with the partition instant being the current time. While for smaller values (a few hours or 1 day offsets) this works well, but makes it harder to test and iterate fast for larger offsets. Larger offset values are typically used for tracking lagging metrics.\r\n\r\nChanging the [initial trigger](https://github.com/spotify/styx/blob/master/styx-api-service/src/main/java/com/spotify/styx/api/workflow/WorkflowInitializer.java#L96) to subtract the offset would solve the issue and would allow for a trigger to happen at the next schedule interval but with partition value which is offset by the given interval behind time. However, this would break the API as documented, since the workflow should trigger after the offset duration, according to the doc.\r\n\r\nProposal:\r\nAdd a separate flag in workflow which would allow only the initial trigger to happen at the next schedule interval. (At the next hour if hourly, at midnight, if daily, etc) with a partition value at 'offset' duration back. The following natural triggers can however happen every 'schedule'. "}}
{"actor":{"display_login":"anish749"}}