How is the beginning of an episodic memory encoded in the brain?
We don't have a full understanding of how episodic recall really happens in the brain, but there are theoretical approaches to understanding memory that are supported (but not shown definitively - it is really difficult to design appropriate experiments that are not beyond current technological capabilities) by experimental evidence. These approaches don't require any sort of hard "start" or "end" signal for episodic memory to work. In these approaches, an episodic memory is thought of as a sequence of brain states that correspond to previously experienced states.

The sequence occurs because connectivity promotes the network to progress from State A to State B to State C, etc. Additionally, all of the states consisting of that one "connected" memory are also associated, so that they prime one another.

To recall, you don't need to start at State A - you can start anywhere in the chain, and just recalling State C will prime you to also recall State A and B, so you can mentally "rewind" the memory a bit (we have no idea how exactly this type of conscious control works), even though it progresses most clearly in the A->B->C sequence.

The point of entry that allows you to initially get in to this chain might not be part of that episodic memory, either. For example, maybe you see a cat, and this leads to to an episodic memory of one event you shared with your own cat 5 years ago.

Brains are very dynamic, they do not behave like a feed-forward computation you might implement in a simple computer program. It is possible that there are "start" or "end" signals for episodic memories that we haven't found yet, but they may not be necessary at all.

For some further reading you could look for references on attractor networks, pattern separation and pattern completion, and theories of memory formation.

The book by Dayan and Abbott on theoretical neuroscience is also a good approach to some of the more basic background and includes an introduction to biologically-inspired models of learning and memory.